S
S
Seva2012-06-22 17:58:56
PHP
Seva, 2012-06-22 17:58:56

How to allow PHP for subdomains?

Good afternoon.

It was necessary to add a subdomain - listing sites-available/default

<VirtualHost *:80>
ServerName nash-dom.info ServerAdmin
[email protected]

DocumentRoot /var/www/nash-dom.info/public_html
<Directory />

AllowOverride All

<Directory /var/ www/nash-dom.info/public_html>

AllowOverride All
Order allow,deny
allow from all

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values ​​include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined


<VirtualHost *:80>
ServerName deputat.nash-dom.info
ServerAdmin [email protected]
DirectoryIndex index.php
DocumentRoot /var/www/deputat.nash-dom.info/public_html
<Directory />

AllowOverride All

<Directory /var/www/deputat.nash-dom.info/public_html>

AllowOverride All
Order allow ,deny
allow from all

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values ​​include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined The


subdomain works, html opens, when you try to open .php it throws 404. At the same time, everything works for the parent site.

Where to dig? Previously, it was not possible to edit the configs with your hands, there was a socket everywhere, but now you have to figure it out.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
gvsmirnov, 2012-06-22
@gvsmirnov

So you will understand completely by reading the documentation .
If laziness, then provide more detailed information: how is the interaction with php organized? If you don't know then

$grep -ir php /path/to/apache2/

On debian-like systems/path/to/apache2/ == /etc/apache2/

N
NBZ4live, 2012-06-23
@NBZ4live

Have you checked the file name?
404 is a file not found error.
In the event that php was not parsed, then you would simply see the source code of the php file.
The only thing that still comes to my mind is SELinux.
But in general, it would not be bad to look at the logs as well. Look in /var/logs/apache/access.log and /var/logs/apache/error.log and post them here.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question