How to install Bugzilla using WAMP ? - wamp

I want to install Bugzilla to my computer.I have WAMP server installed.Is there a way to add Bugzilla using WAMP server?

Here is the documentation to install Bugzilla on a Windows environment : https://bugzilla.readthedocs.io/en/5.0/installing/windows.html
In this documentation there is a special page to configure Apache (which is embedded in WAMP) to run your bugzilla instance : https://bugzilla.readthedocs.io/en/5.0/installing/apache-windows.html#apache-windows
You have to :
Uncomment LoadModule cgi_module modules/mod_cgi.so at the beginning of
the file to enable CGI support.
Uncomment AddHandler cgi-script .cgi
to register .cgi files as CGI scripts. For this handler to work, you
must create a key in the Windows registry named
HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command with the default value
pointing to the full path of perl.exe with a -T parameter. For example
C:\Perl\bin\perl.exe -T if you use ActivePerl, or
C:\Strawberry\perl\bin\perl.exe -T if you use Strawberry Perl.
Add an Alias and a Directory for Bugzilla:
httpd.conf :
Alias "/bugzilla/" "C:/bugzilla/"
<Directory "C:/bugzilla">
ScriptInterpreterSource Registry-Strict
Options +ExecCGI +FollowSymLinks
DirectoryIndex index.cgi index.html
AllowOverride All
Require all granted
</Directory>
And then restart Apache.

Related

mod_wsgi: "No module named 'django'"

Maybe some needed context:
I installed python3.9 into a directory /opt/python39/. I compiled mod_wsgi with this version of python (as per this post) and was able to conduct a test to make sure that it was working correctly. I am not using a virtual environment.
I am trying to move my django project to production, so naturally, I am following the django docs. When I use the default file configurations at the very beginning, i.e.:
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
WSGIPythonHome /opt/python39/bin/python3.9
WSGIPythonPath /path/to/mysite.com
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
It works (for the most part - there are resources missing on the page, but thats for another SO post) like a charm.
So I continue through the docs (which is now telling me that I should move it to "Daemon mode"):
“Daemon mode” is the recommended mode for running mod_wsgi (on non-Windows platforms). To create the required daemon process group and delegate the Django instance to run in it, you will need to add appropriate WSGIDaemonProcess and WSGIProcessGroup directives. A further change required to the above configuration if you use daemon mode is that you can’t use WSGIPythonPath; instead you should use the python-path option to WSGIDaemonProcess, for example:
So I change my file to look like:
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
#WSGIPythonHome /opt/python39/bin/python3.9
#WSGIPythonPath /path/to/mysite.com
WSGIDaemonProcess mysite.com python-home=/opt/python39/bin/python3.9 python-path=/path/to/mysite.com
WSGIProcessGroup mysite.com
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
then run sudo apachectl restart, go back to my browser, refresh, shows 500 internal server error, check my logs, and "what do you know?" - ImportError: "No module named 'django'".
I've come across this SO article that seems to be describing my problem, but for virtual environments, and offers a solution, but I give it a go anyway:
WSGIProcessGroup mysite.com
WSGIDaemonProcess mysite.com python-home=/opt/python39 python-path=/path/to/mysite.com
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py process-group=iengravethat.com application-group=%{GLOBAL}
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
I rerun sudo apachectl restart, check my browser - same error, check the logs - same error.
I have tried a multitude of other configurations, but they all boil down to this error. Does anyone have any idea as to how to remedy this problem?
---UPDATE---
SUTerliakov and I opened up a channel for discussion, the end conclusion was thus:
Regarding recompilation - I was absolutely happy with the following installation (from Dockerfile, but it doesn't really matter):
pip install -U --no-cache-dir mod-wsgi
mod_wsgi-express install-module | tee /etc/apache2/mods-available/wsgi_express.load /etc/apache2/mods-available/wsgi_express.conf
And it can be done from venv too.
I really don't understand why did your paths stop working after
switching to daemon mode. I just suggest to try virtualenv instead,
because this method is recommended by maintainer.
You can just drop "tee" part and use standalone mod_wsgi-express install-module. It will print two lines of config, you can add them to your config file manually. It will print WSGIPythonHome, take this value and use for python-home option of WSGIDaemonProcess.
(may require root, AFAIR)
So, basically just create a venv and link it in your .conf file.
Create a virtual environment with the python interpreter you want to use and activate it.
pip install the packages you were using for django.
pip install mod-wsgi.
Grab the version of mod_wsgi you want.
untar it and enter the directory.
./configure --with-python=python3 (This python3 is the same version as the python3 I wanted - not python 3.6 which comes pre-installed on centos7).
make LDFLAGS='-L/path/to/venv/lib -Wl,-rpath,/path/to/venv/lib'.
sudo make install.
run mod_wsgi-express module-config and copy and paste it at the top of your .conf file.
deactivate your environment.
restart apache - sudo apachectl restart
I have the following config:
ServerName ${SERVER_NAME}
ServerAdmin ${SERVER_ADMIN}
<IfModule unixd_module>
User ${APP_USER}
Group ${APP_USER}
</IfModule>
WSGIRestrictEmbedded On
WSGIPassAuthorization On
IncludeOptional /etc/apache2/conf.d/*.conf
Timeout 60
<VirtualHost *:80>
Redirect permanent / https://${SERVER_NAME}/
</VirtualHost>
<VirtualHost *:443>
Alias /media <media folder>
<Directory <media_folder> >
Options -Indexes
Require all granted
</Directory>
Alias /static <static_folder>
<Directory <static_folder> >
Options -Indexes
Require all granted
</Directory>
WSGIDaemonProcess <name> processes=1 threads=5 display-name=%{GROUP} home=<top_folder>
WSGIScriptAlias / <wsgi.py path> process-group=<name> application-group=%{GLOBAL}
... SSL config here ...
</VirtualHost>
It is not a full config: logging, SSL and WebSocket proxies are thrown away.
<name> is any alias
<top_folder> is folder with manage.py file
<wsgi.py path> is <top_folder>/something/wsgi.py
<media_folder> and <static_folder> are paths of MEDIA_ROOT and STATIC_ROOT settings.
It is deployed with docker (system-level package installation as root, no virtual environment).
Final attempt
Probably something gets messed up when using system python that is not the default interpreter. You can set up virtual environment and make httpd use it. To avoid manual recompilation, mod_wsgi pip package can be used:
# With venv activated
pip install mod_wsgi
sudo mod_wsgi-express install-module
This will install mod_wsgi for venv python and print two lines of config: LoadModule ... and WSGIPythonHome <path>. You can add LoadModule to configuration file and use the following daemon config:
WSGIDaemonProcess mysite.com home=/path/to/mysite.com python-home=<venv_root>
Note
You don't need to recompile mod_wsgi manually with this package, it is the most amazing aspect of such installation! Two commands above are sufficient to install mod_wsgi. It will copy module files to required folders for you (see end of this readme), so your steps 4-8 can be omitted.

Google Cloud Platform LAMP setup Laravel 5.4

Looking for help on server problem. I have followed the following steps to set up LAMP on the VM
https://cloud.google.com/community/tutorials/setting-up-lamp
I put my Laravel 5.4 website onto the VM, configure the .env for the following:
APP_URL=website_external_IP
But when I access the website by inserting the website_external_IP on my browser, it returns the following image.
Sorry for being noob of server problems but please let me know what else information should I provide for you to figure out the cause of it. Thank you!
1 EDIT:
In response to John Hanley's suggested site. I further made the following edits on the apache conf:
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/laravel_project.conf
sudo vim /etc/apache2/sites-available/laravel_project.conf
and there vim the laravel_project.conf as followings
NameVirtualHost *:8080
Listen 8080
<VirtualHost *:8080>
ServerAdmin admin#example.com
ServerName laravel.dev
ServerAlias www.laravel.dev
DocumentRoot /home/user/projects/laravel_project/public
<Directory /home/user/projects/laravel_project/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
LogLevel debug
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
then
sudo vim /etc/hosts
and add the following line:
127.0.0.1 laravel.dev
then disabled the original conf settings and enable for my site:
sudo a2dissite 000-default.conf
sudo a2ensite laravel_project.conf
Without having the full understanding of the new edits procedures, accessing the page with IP returns the following error:
You don't have permission to access / on this server.
Your Apache web server has directory browsing enabled. Also you do not have a default page present (or enabled) therefore you server is serving up the directory listing.
/etc/apache2/apache2.conf
Remove the word Indexes from this part of your configuration:
<Directory /var/www/>
Options Indexes FollowSymLinks
...
</Directory>

Django project doesn't show up with Apache and mod_wsgi

I've installed Apache and mod_wsgi on windows xp service pack 3 and added these line to my httpd.conf :
WSGIScriptAlias / "C:/Documents and Settings/X/My Documents/Downloads/Foo/Foo/wsgi.py"
WSGIPythonPath "C:/Documents and Settings/X/My Documents/Downloads/Foo"
<Directory "C:/Documents and Settings/X/My Documents/Downloads/Foo/Foo">
<Files wsgi.py>
Require all granted
</Files>
</Directory>
but when I open localhost on my firefox, it shows Apache's It Works! message, what should I do to run my project on localhost ?
EDIT :
I checked and recognized that my project's path is not included in PYTHONPATH. Isn't the line WSGIPythonPath ... expected to add the address to PYTHONPATH ?
Alright, so my setup is in linux so this is not tested on windows, but:
I did not see your LoadModule statement
File: httpd.conf
LoadModule wsgi_module modules/mod_wsgi.so
modwsgi wont work without that.
Also: the your grant statement seems a bit suspicious.
In the wsgi configuration guide suggests using a Directory directive for allowing this access to your mod_wsgi application.
<Directory "C:/Documents and Settings/X/My Documents/Downloads/Foo/Foo/">
Order allow,deny
Allow from all
</Directory>
Finally:
Make your life easy down the road.
configure apache in worker mode
configure mod_wsgi in daemon mode.
profit
Might I suggest watching this PyCon talk Making Apache suck less for hosting Python web applications from 'the-man' Graham. I wish I knew all of that stuff years ago.
Note: To figure out if you have apache in mpm worker mode.
httpd.exe -V
look for the "Server MPM" value of worker.
Django runs on port 8000 so you'll want to do two things. First, you need to run the server by entering into your console python manage.py runserver. Second, you need to direct your browser to localhost:8000.
As an aside, you don't need Apache to run a simple, local development environment. Django has its own server built in that you can leverage.

Configuring Apache 2 with mod_wsgi for Django - no httpd.conf file

I am using Apache 2 on raspbian os. I read somewhere that in the newest versions of Apache there is no httpd.conf file, is this true? [Edit] (This is true)
My apache server is running (I can see the default web page), and mod_wsgi is successfully installed. So I began the instructions here for using django 1.5 with apache. However it tells me I need to add the following lines to the httpd.conf file:
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath /path/to/mysite.com
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
However, there is no httpd.conf file present in my version of apache. I have checked /etc/httpd/confand /etc/apache2 for the http.conf file. /etc/apache2 is where apache is though.
In short, where should I add the required settings so that apache recognizes mod_wsgi.
Possibly, many distros use
/etc/apache2/apache2.conf
Instead. However you shouldn't really edit that and it affects apache2 globally, i.e. all you sites (virtual-hosts). If you have only the one site better edit the contents of:
/etc/apache2/sites-available/default
The Ubuntu Apache2 configuration documentation is a good getting started guide: https://help.ubuntu.com/14.04/serverguide/httpd.html#http-configuration
Here is tutorial configuring Apache2 with mod_wsgi for Django on Ubuntu 11.04 wihtout httpd.conf: http://blog.madspace.me/configure-python-django-with-apache/, and one on 12.04: http://www.lennu.net/2012/05/14/django-deployement-installation-to-ubuntu-12-dot-04-server/

Running a C++ cgi program on apache?

I'm experimenting with compiled cgi's on a test server, but I can't seem to get them to run.
I added this to apache;
<Directory /var/www/app>
AllowOverride All
Options +ExecCGI
AddHandler cgi-script .cgi
</Directory>
Even tried this:
<Files "/var/www/app/monkey.cgi">
Options +ExecCGI
</Files>
But every time it runs, apache tells me
Fri Aug 17 01:55:07 2012] [error] [client 192.168.1.66] Options ExecCGI is off in this directory: /var/www/app/monkey.cgi
I've done this before, and it's worked, but it's been awhile. Off the top of your head, can you tell me if I'm making any glaring mistakes?
Thanks.
Is there any .htaccess file in your directory? And check the whole conf to see if you're not messing it up somewhere.
Additional info: Apache does add some defaults concerning CGI scripts on some version or distributors add those defaults.
Have you tried reloading your Apache configuration? The below command line works in general:
sudo service apache2 force-reload
Otherwise might have to refer to other command line commands as based on your Linux distro as seen in link below which covers it more specifically:
http://www.microhowto.info/howto/cause_a_system_service_to_reload_its_configuration.html