I am running a page based on Flask and Apache2/MOD_Wsgi and am wanting to also deploy a page using PHP (a IDE called Codiad). Flask as my main page ( enjay.work ) and I want Codiad to run on enjay.work/codiad
Unfortunately I have the most basic understanding of Apache config and don't know at all how to find what I need.
Here is what I have so far:
<virtualhost *:80>
ServerName enjay.work
DocumentRoot /home/nathan/www/enjay
WSGIDaemonProcess enjay user=nathan group=www-data threads=5 home=/home/nathan/www
WSGIScriptAlias / /home/nathan/www/enjay/enjay.wsgi
<Directory /Codiad>
Options indexes FollowSymlinks MultiViews
AllowOverride All
Require all granted
Allow from all
</Directory>
<Directory />
WSGIProcessGroup enjay
WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
Require all granted
</Directory>
</virtualhost>
now when I navigate to enjay.work/Codiad I get a 404 page. for the php project I am adding to my site I followed these directions (loosly)
I can get just the python to work, or just the PHP to work, when I combine the two Config files I get the Python page but the path that should return the PHP gives me a 404
Change the configuration for your PHP page to point directly at the project (in this case /home/nathan/www/enjay/Codiad) then above that configuration add an alias for the web address you want
Alias /Codiad "/home/nathan/www/enjay/Codiad"
<Directory /home/nathan/www/enjay/Codiad>
**Existing Config**
</Directory>
I think it should be like this.
<Directory /home/nathan/www/enjay>
Options indexes FollowSymlinks MultiViews
AllowOverride All
Require all granted
Allow from all
</Directory>
Related
My project works fine on Openserver in Windows. But now I am trying to transfer it to Ubuntu.
So the home page is available (but all external scrips, css, js and images returns 404 error). Also, every internal page is not available (The requested URL /blablabla was not found on this server).
What am I doing wrong?
Mod_rewrite is enabled, apache logs have no errors.
I figured out.
Just need replace
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
to this:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
In apache.conf
I'm new to Linux and PHP and I'm trying to access a Laravel app from another device.
Server is running a Centos and it's IP is 192.168.1.250 and my Laravel directory is /var/www/html/vls.
At first it was showing directory listing when I wen to 192.168.1.250/vls in my browser. After some search I added these lines to httpd.con:
<Directory /var/www/html/vls>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<VirtualHost *:80>
DocumentRoot "/var/www/html/vls/public"
ServerName vls.dev
<Directory /var/www/html/vls/>
AllowOverride All
Order deny,allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
Now when I go to 192.168.1.250/vls it shows index.php content as text in browser.
I even followed the solution described here:
How to stop laravel directory browsing
But then it showed directory listing of /public directory.
Any help is appreciated in advance.
EDIT:
If I make a directory and place an index.php code that includes some PHP code it works fine. But Laravel app doesn't work and shows index.php code on the browser.
Change your dir from <Directory /var/www/html/vls/> to <Directory /var/www/html/vls/public>
I am configuring website outside the htdocs and I did all changes what are describe here Virtual Host.
But partially it done but routes are not working. Only Home page showing. rest of page showing Object not found!.
like
<VirtualHost *:81>
DocumentRoot "C:\DevlopmentApps\VirtualMarket"
ServerName sjb.localhost
<Directory C:\DevlopmentApps\VirtualMarket>
Options Indexes
AllowOverride none
Require all granted
</Directory>
Now
http://sjb.localhost:81/sjb is working
http://sjb.localhost:81/sjb/find/ not working
Now i figure out some thing that other should be aware with.
If want to configure outside the htdocs the need to do following steps in the follwong link
Virtual host
Here is some thing Deprecated. https://stackoverflow.com/questions/9110179/adding-virtualhost-fails-access-forbidden-error-403-xampp-windows-7?answertab=votes#tab-top
<Directory ..........>
# AllowOverride All # Deprecated
# Order Allow,Deny # Deprecated
# Allow from all # Deprecated
# --New way of doing it
Require all granted
</Directory>
Now one thing which fixed my issue is
Options All
AllowOverride All
Require all granted
I installed Wamp Server on Windows 8. I then installed a php web application.
I can access it by going http:// localhost/webapp or http:// localhost/phpmyadmin
I want to be able to access this web app from different computers on the same network.
The problem is when I try to visit my web app via this http:// 192.168.133.221/webapp (which is my local ip address) or http:// mypc/webapp (which is my PC's name) - I get the following error
403 Forbidden You don't have permission to access /fengoffice on this
server.
I have disabled both windows firewall and Kaspersky's firewall but still getting the same error.
Any advise?
Salim was on the right track, but he is rather giving away all the crown jewels.
Do not make this change to httpd.conf as it is not necessary to open the wamp home folder up to the world! As this would allow access to your new site, but also any other site you may then want to develop in another folder below c:\wamp\www.
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Replace it with the original, like this
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order Deny,Allow
Deny from all
</Directory>
To allow your one site to be accessed from just your internal network, do this. Under the previous section add a new <Directory> block. ( change the folder name webapp as appropriate for your directory name )
<Directory "C:/wamp/www/webapp">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
Allow from 192.168.133
</Directory>
This will allow access from the PC running WAMP AND any ip address on your subnet i.e. all the PC's inside your router. BUT NOT THE WORLD!
You can be more specific if you want and add as many individual IP address's as are required by:
Allow from 192.168.133.1 192.168.133.2 192.168.133.3
Now to allow access to phpMyAdmin from your internal network we use the same idea in the config for phpMyAdmin
Edit c:\wamp\alias\phpmyadmin.conf and make simpliar changes.
<Directory "c:/wamp/apps/phpmyadmin4.0.6/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1 localhost
Allow from 192.168.133
</Directory>
This way when you decide to open up your router to the world ( port forward port 80 ) so your site is visible to friends/the world you can change the section of code that relates to your sites folder i.e. C:/wamp/www/webapp but external users will not be able to access your wamp homepage or more inportantly your phpMyAdmin and therefore ALL your databases.
And one final thing, you will also have to change the MYSQL userid that you are using ( probably root, although it would be better to create another userid ) so that it is allowed access from a PC that is not on the main WAMP PC.
This may help you with that Add host to mysql user
EDIT: Apache 2.4.x Equivalents
No longer required
Order Deny,Allow
Replece:
Allow from 127.0.0.1 ::1 localhost
with
Require local
Replace:
Allow from 192.168.133
with
Require ip 192.168.133
Replece:
Allow from all
with
Require all granted
Without 127.0.0.1 from all IP address your Apache server is forbidden to access.
Open httpd.conf(Apachee config file) file from where you have installed Wamp Server and see in this file
<Directory "C:/wamp/www/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
And
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
C:/wamp/www will be as your installed location
Change it to
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
And
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
And restart service.
I just installed WAP 2.2 d, on my local machine. It runs on Wndows 7 Starter. The installation was done smoothly. Then when I hit the URL localhost/phpmyadmin it gave me a message
**Forbidden**
You don't have permission to access /phpmyadmin/on this server.
Then after doing some research on this issue I found one solution as to make the change in file wamp/alias/phpmyadmin.conf
The initial lines were
<Directory "c:/wamp/apps/phpmyadmin3.4.10.1/">
Options Indexes FollowSymLinks MultiViews
Order Deny, Allow
Deny from all
Allow from 127.0.0.1
</Directory>
I changed these line to following lines:
<Directory "c:/wamp/apps/phpmyadmin3.4.10.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow, Deny
Allow from all
</Directory>
Then the phpMyadmin started working properly at URL localhost/phpmyadmin
After that I copied my directory 'XYZ' containing small project of PHP. Hit the URL localhost/XYZ, then it was expected to run the index.php file from the folder XYZ but it's still giving me the error
**Forbidden**
You don't have permission to access /XYZ on this server.
Can you help me to resolve this issue and run the system properly. Except above change to wamp/alias/phpmyadmin.conf I've not done any change to any of configuration file. Thanks in advance.
You must allow access to your XYZ directory in Apache configuration file httpd.conf:
<Directory "c:/wamp/apps/XYZ">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow, Deny
Allow from all
</Directory>
The reason for this problem is most likely because W7 has IPV4 and IPV6 enabled.
Apache is happy to listen to both ranges of port numbers, and by default does.
A better more secure solution would be:
<Directory "c:/wamp/apps/phpmyadmin3.4.10.1/">
Options Indexes FollowSymLinks MultiViews
Require local
</Directory>
Require local is like saying Allow from 127.0.0.1 localhost ::1 i.e. both IP Address ranges alias's for this PC.
Also if you do as you did and Allow from all when you decide to show a friend what you have done and open you router so the world can see your new site, they will also be given access to phpMyAdmin making a hackers life really easy
Secondly, you do not make the change suggested by #user4035, instead edit the httpd.conf and look for this section
<Directory "d:/wamp/www/">
Where is says,
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Change it in the same way as above, to
Require local
For the same security reason as above. When the time comes to show the world your site you can add the
<Directory "c:/wamp/apps/XYZ">
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>
To allow anybody to see just that website but nothing else.