I am setting a VPS with one IP adress to serve multiple websites. The first one is running. The second only shows an Index of / listing the two folders containing files of the two websites within the default DocumentRoot /var/www/html. When I click on the site folder it gives me a shadow html version of the site (no images, no content, no links working).How can I force the second sebsite to be served from the folder already defined in the .conf file?
This is for a new Linux server, running MySQL 5, PHP 5 and Apache 2. Both websites wordpress latest version.
First website (running) firstsite.com.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName firstsite.com
ServerAlias www.firstsite.com
DocumentRoot /var/www/html/firstsite
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html/firstsite>
AllowOverride All
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Second website (not running) secondsite.com.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName secondsite.com
ServerAlias www.secondsite.com
DocumentRoot /var/www/html/secondsite
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html/secondsite>
AllowOverride All
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I expect to output the frontend of the website secondsite.com, but the actual output is:
Index of /
[ICO] Name Last modified Size Description
[DIR] firstsite/ 2019-04-28 17:00 -
[DIR] secondsite/ 2013-09-25 00:18 -
/var/www/html/secondsite
. What is the content oftest/
andexample/
? Are they actually present at/var/www/html/secondsite
?/var/www/html
as root. Is the config correct? No typos? Doessudo systemctl -u apache2
show any warnings?sudo systemctl -u apache2
givessystemctl: invalid option -- 'u'
sudo journalctl -u apache2