why wamp server put online/ offline option is missing? - wamp

I'm using windows 8. recently i've installed wampserver3_x86_apache2.4.17_mysql5.7.9_php5.6.15. but the put online/offlline option is missing. I did wamp manager->wamp settings->menus item online/offline. it doesn't work also. there is no green the green mark beside this option.
What to do?

Its not missing it is now an optional menu
Right click Wampmanager -> WAMPSetting -> Menu Item: Online/Offline
If you click it so there is a Tick beside it, you will see the Online/Offline menu on the left click menu.
However it was made optional as its use is defunct.
You should create Virtual Hosts for each of your projects, then you can amend each of those individually to control the Apache access rules.
In fact in WAMPServer 3 or greater, there is a Virtual Host defined for localhost so this old Online/Offline process wont actually do what you want.
You now have to go to the wamp\bin\apache\apache{version}\conf\extra\httpd-vhosts.conf file and manually amend that entry
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp/www
<Directory "D:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted #<-- changed line
</Directory>
</VirtualHost>
This file can be edited using the wampmanager menus like this
wampmanager -> Apache -> httpd-vhosts.conf
However it is not recommended to allow this sort of access to localhost. It is better to create a Virtual Hosts for each of your projects eg
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp/www
<Directory "D:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName project1.dev
DocumentRoot D:/wamp/www/project1
<Directory "D:/wamp/www/project1">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Related

Host both PHP/JS and Django applications with Apache on Windows

I have a WAMP Server 3.2 (Apache 2.4.46) installed on Windows 10 (64-bits), it is exposed to the local company network. I use it to host ordinary php/js applications. My httpd-vhosts.conf is used to look like this:
<VirtualHost *:80>
ServerName RealNameOfTheServer
DocumentRoot "d:/projects"
<Directory "d:/projects/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Now I got a Django app which preferably needs to be hosted with the same server (since I don't have any other) along with other php applications. I tried to follow the example to configure my virtual hosts, but it uses daemon process which is not available on Windows.
My httpd-vhosts.conf after applied changes makes Django app work correctly but dumps php/js apps.
<VirtualHost *:80>
ServerName RealNameOfTheServer
DocumentRoot "d:/projects"
<Directory "d:/projects/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
WSGIPassAuthorization On
ErrorLog "logs/dashboard.error.log"
CustomLog "logs/dashboard.access.log" combined
WSGIScriptAlias / "d:\projects\dashboard\dashboard\wsgi_windows.py"
WSGIApplicationGroup %{GLOBAL}
<Directory "d:\projects\dashboard\dashboard">
<Files wsgi_windows.py>
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Files>
</Directory>
Alias /static "d:/projects/dashboard/static"
<Directory "d:/projects/dashboard/static">
Require all granted
</Directory>
</VirtualHost>
Is there any way to run both php and Django apps on Windows?
WSGIScriptAlias / "d:\projects\dashboard\dashboard\wsgi_windows.py"
will also catch calls to "d:/projects" - so if you want to avoid that, you need to change to something like
WSGIScriptAlias /my_wsgi_app/ "d:\projects\dashboard\dashboard\wsgi_windows.py"
If you want to avoid that the user can see that, you can use a rewrite rule for certain paths.

Configuring VirtualHost to run a second website, issue with <VirtualHost *:8080>, error with `Listen`

I am trying to figure out how to host a second Django website from my VM and I am wondering if somebody could see where I have made any obvious mistakes.
Currently whichever site is set to <VirtualHost *:80> works. I learned from this answer that I should specify the second website to <VirtualHost *:8080>. However when I try to use Listen I get the below error when I try to reload apache
Job for apache2.service failed. See 'systemctl status apache2.service'
and 'journalctl -xn' for details.
Does anyone understand what might be going wrong?
Why does <VirtualHost *:80> but not <VirtualHost *:8080>?
And why do I get the error when I specify Listen?
I am using Debian 8.5, Apache 2.4.10 and mod-wsgi 4.3.0-1.
Listen 80
<VirtualHost *:80>
ServerName myserver.scss.tcd.ie/bias_experiment/
Alias /bias_experiment/static/ /var/www/bias_experiment/static/
<Directory /var/www/bias_experiment/static>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias /bias_experiment /var/www/bias_experiment/src/bias_experiment/index.wsgi
<Directory /var/www/bias_experiment/src/bias_experiment>
<Files index.wsgi>
Order deny,allow
Allow from all
</Files>
</Directory>
</VirtualHost>
Listen 8080
<VirtualHost *:8080>
ServerName myserver.scss.tcd.ie/bias_experiment_two/
Alias /bias_experiment_two/static/ /var/www/bias_experiment_two/static/
<Directory /var/www/bias_experiment_two/static>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias /bias_experiment_two /var/www/bias_experiment_two/src/bias_experiment/index.wsgi
<Directory /var/www/bias_experiment_two/src/bias_experiment>
<Files index.wsgi>
Order deny,allow
Allow from all
</Files>
</Directory>
</VirtualHost>
Any help is as always, much appreciated.
You can't set ServerName as you are. The ServerName directive must be a host name only else named based virtual hosts will not work when you have multiple VirtualHost definitions. The only reason anything would be handled at all as is is because when name based virtual hosts are not set up correctly, or no host name matches, Apache will send requests to the first VirtualHost found when the configuration was read. What you should be doing is have everything in one VirtualHost if you want them to be access via the same host name. Using different ports could be used, but is less convenient.
<VirtualHost *:80>
ServerName myserver.scss.tcd.ie
WSGIDaemonProcess bias_experiment
Alias /bias_experiment/static/ /var/www/bias_experiment/static/
<Directory /var/www/bias_experiment/static>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias /bias_experiment /var/www/bias_experiment/src/bias_experiment/index.wsgi \
process-group=bias_experiment application-group=%{GLOBAL}
<Directory /var/www/bias_experiment/src/bias_experiment>
<Files index.wsgi>
Order deny,allow
Allow from all
</Files>
</Directory>
WSGIDaemonProcess bias_experiment_two
Alias /bias_experiment_two/static/ /var/www/bias_experiment_two/static/
<Directory /var/www/bias_experiment_two/static>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias /bias_experiment_two /var/www/bias_experiment_two/src/bias_experiment/index.wsgi \
process-group=bias_experiment_two application-group=%{GLOBAL}
<Directory /var/www/bias_experiment_two/src/bias_experiment>
<Files index.wsgi>
Order deny,allow
Allow from all
</Files>
</Directory>
</VirtualHost>
To keep the WSGI applications separate, two separate daemon process groups are declared and each WSGI application delegated to a different process group.
The two WSGI applications would then be accessed as:
http://myserver.scss.tcd.ie/bias_experiment
http://myserver.scss.tcd.ie/bias_experiment_two
If these are Django sites, you likely will have additional setup changes you will need to make in the Django settings file, to allow both to run under the same host name and not interfere with each other.

WAMP icon colors

I'm running Wamp 3.0.0 64bit on Windows 10. In past versions the icon was either red, orange or green depending on status. Now the green version has a red dot in it, and the background color is pale yellow rather than clear as it is on the red and orange versions.
Does anyone know the significance of the background color or the red dot?
It seems I gave you some wrong advice above in my comments.
The icon you speak about is in fact a new Icon I had forgotten about.
This image indicates that you have set WAMPServer Online i.e. you have used the Online/Offline menu and set Apache to be Online.
NOTE: It is not necessary to have set Apache Online for normal development activity. Online only means that Apache can be accessed by any IP Address in the universe.
In other words when Online the httpd.conf file contains this parameter in the
<Directory "D:/wamp/www/">
section on httpd.conf
# onlineoffline tag - don't remove
Require all granted
when normally it has
# onlineoffline tag - don't remove
Require local
Unless you are actually trying to access your site from the internet it is not required to be Online.
Additional info after clarification
Ok, so if you are just trying to open up to connections from your local network then you have to do this. WAMPServer3 added the use of localhost as a Virtual Host by default. So now you should leave the httpd.conf files as
# onlineoffline tag - don't remove
Require local
Now edit \wamp\bin\apache\apache{version}\conf\extra\httpd-vhost.conf and add your access requirements to that like this
The default is this
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
So just add requirements like this
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
Require ip 192.168.0.1
Require ip 192.168.0.2
</Directory>
</VirtualHost>
Or add this for any ip in your local network
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
Require ip 192.168.0
</Directory>
</VirtualHost>

you don't have permission to access [custom alias] on this server

can anyone help with a following issue:
I am using wamp to run projects in my chrome browser.
after adding a newAlias which points to my project directory c:/dev/myProject
I am getting Forbidden message: you don't have permission to access /newAlias on this server.
I can access default Aliases such as phpmyadmin, webgrind...
but i cannot access my own.
I am using WampServer Version 2.5 64bit on Win 8.1 64bit located in c:/wamp.
I tried basic stuff from the net but with no luck.
Any suggestions?
Edit: content of newAlias:
Alias /bs1/ "c:/_DEV_/git/NewProject/www/"
<Directory "c:/_DEV_/git/NewProject/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
Dont change that section of your httpd.conf. Those few lines control access to the root folder of the drive that Apache is installed on. So you just gave full access to anybody with a handy hack.
The process of securing the access via Apache is to deny all access to everything from the root folder and below, and then selectively allow access for specific sites to specific areas/folders of the drive.
A better solution would be to change httpd.conf back to how it was and make the change in your Alias definition. Like this :-
Alias /bs1 "c:/_DEV_/git/NewProject/www/"
<Directory "c:/_DEV_/git/NewProject/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local <-- to develop on this PC
Require ip 192.168.1 <-- to access the server from another PC on your network
Require all granted <-- to allow the world to see the beauty of your site
</Directory>
It is actually a better idea to use Virtual Hosts to control each site and not Alias's.
Here is a why and Howto :- WAMPServer 2.5 The Homepage, Your Projects Menu and the need for Virtual Hosts
I've updated WAMP from 2.2.22 to 2.4.9 and found that new aliases didn't work (same error message as yours).
Checking the default aliases like phpmyadmin, I've found this:
Alias /phpmyadmin "c:/wamp/apps/phpmyadmin4.1.14/"
# to give access to phpmyadmin from outside
# replace the lines
#
# Require local
#
# by
#
# Require all granted
#
<Directory "c:/wamp/apps/phpmyadmin4.1.14/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
<IfDefine APACHE24>
Require local
</IfDefine>
<IfDefine !APACHE24>
Order Deny,Allow
Deny from all
Allow from localhost ::1 127.0.0.1
</IfDefine>
php_admin_value upload_max_filesize 128M
php_admin_value post_max_size 128M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360
</Directory>
If you see the contents of the file you'll notice the <IfDefine APACHE24> and <IfDefine !APACHE24> conditionals. So I've changed my alias .conf file from:
Alias /svn "c:/work/website-svn/"
<Directory "c:/work/website-svn/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
to:
Alias /svn "c:/work/website-svn/"
<Directory "c:/work/website-svn/">
Options Indexes FollowSymLinks MultiViews
Require local
</Directory>
That solved my problem, I hope it solves yours.
I am no expert on this but the answer above seemed like I was granting access to my entire computer...So tried modifying the above answer to only giving access to where my alias folder is...
So instead...Go to the httpd.conf file...and do a search for...
<Directory />
AllowOverride none
Require all denied
</Directory>
and below that add the following
<Directory "c:/path-to-your-alias-folder...">
AllowOverride none
Require all granted
</Directory>
This worked to me and I think it might be a bit safer...Again I am no expert here...Just trying to make it work...
for allow permission for your server & wamp you require 3 steps please ensure these 3 things after that you can access your site from other network with ip address e.g http://192.168.1.1/yoursitefoldername
(192.168.1.1 is you computer or vps ip address "yoursitefoldername" is folder name of your site which should be in your wamp->www folder)
1.
first of all
Port 80 and 443 must be allow for both TCP and UDP packets. To do this, create 2 inbound rules for TPC and UDP on Windows Firewall for port 80 and 443.
(or you can disable your whole firewall for testing but permanent solution if allow inbound rule)
2.
If you are using WAMPServer 3 See bottom of answer
For WAMPServer versions <= 2.5
You need to change the security setting on Apache to allow access from anywhere else, so edit your httpd.conf file.
Change this section from :
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
To :
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all
if "Allow from all" line not work for your then use "Require all granted"
then it will work for you.
WAMPServer 3 has a different method
In version 3 and > of WAMPServer there is a Virtual Hosts pre defined for localhost so dont amend the httpd.conf file at all, leave it as you found it.
Using the menus, edit the httpd-vhosts.conf file.
It should look like this :
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp/www
<Directory "D:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Amend it to
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp/www
<Directory "D:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Hopefully you will have created a Virtual Host for your project and not be using the wamp\www folder for your site. In that case leave the localhost definition alone and make the change only to your Virtual Host.
3.
Dont forget to restart All Services of Wamp or Apache after making this change
I found a solution which worked for me.
In httpd.conf i changed:
<Directory />
AllowOverride none
Require all denied
</Directory>
to
<Directory />
AllowOverride none
Require all granted
</Directory>
Which solved the issue and allowed me to access my custom aliases.
I would suggest that you consider setting up virtual hosts instead. It takes a few more minutes, but it's more bulletproof. RiggsFolly's answer to a similar question is excellent in its detail, rigor, and utility:
Project Links do not work on Wamp Server

when configuring mod_wsgi for django 1.4 apache fails to start on mac osx after adding WSGIPythonPath to the virtual host config

I followed the django docs on how to deploy django 1.4 to apache using mod_wsgi https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/ on mac osx lion and when I add the WSGIPythonPath directive apache cant restart .Yet without it my app is non existant in the path . In the log I am getting an error that reads
WSGIPythonPath cannot occur within VirtualHost section
here is what my virtual host config looks like
<VirtualHost *:80>
ServerAdmin jmured#gmail.com
DocumentRoot "/Users/jamo/code/work/projects/bfpd/fapp"
ServerName bfpd.dev
ServerAlias bfpd.dev
ErrorLog "/private/var/log/apache2/bfpd.dev-error_log"
CustomLog "/private/var/log/apache2/bfpd.dev-access_log" common
Alias /static/ /Users/jamo/code/work/projects/bfpd/fapp/fapp/static/
<Directory /Users/jamo/code/work/projects/bfpd/fapp/fapp/static>
Options Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
AllowOverride All
Order allow,deny
Allow from all
IndexOptions FancyIndexing
</Directory>
WSGIScriptAlias / /Users/jamo/code/work/projects/bfpd/fapp/fapp/wsgi.py
WSGIPythonPath /Users/jamo/code/work/projects/bfpd/fapp/
<Directory /Users/jamo/code/work/projects/bfpd/fapp/fapp>
Options Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
what am i doing wrong ???
I fixed it.
WSGIPythonPath /Users/jamo/code/work/projects/bfpd/fapp/
should be in http.conf
As mentioned in the comment by nemesisfixx, and specified by the error in your original question:
WSGIPythonPath cannot occur within VirtualHost section
Moving WSGIPythonPath outside of VirtualHost resolved Apache crashing on OS X server.
$ cat sites/0000_any_80_mysite.com.conf
WSGIPythonPath /Library/Server/Web/Data/Sites/mysite/django-app:/Users/owen/.virtualenvs/mysite:/Users/owen/.virtualenvs/mysite/lib/python2.7/site-packages
<VirtualHost *:80>
ServerName mysite.com
ServerAdmin admin#example.com
DocumentRoot "/Library/Server/Web/Data/Sites/mysite/site"
...
WSGIScriptAlias /api /Library/Server/Web/Data/Sites/mysite/django-app/mysite/wsgi.wsgi
...
<VirtualHost>
It took a lot of putzing for me to get the paths correct (including full path to site-env, which I initially thought would be included automatically after adding the virtualenv top level).