Issue
I'm trying to setup a wordpress site on my server that also hosts another website. I can only get the wordpress site to work with the web address blog.murmilosoftware.com/wp
.
I want to be able to simply access it from blog.murmilosoftware.com
.
The problem is when I type blog.murmilosoftware.com
in right now it displays the same page that is available from murmilosoftware.com
.
I have attached both of the sites-available config files from /etc/apache2/sites-available
.
blog.murmillosoftware.com.conf
Alias /wp/wp-content /var/lib/wordpress/wp-content
Alias /wp /usr/share/wordpress
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
</Directory>
<Directory /var/lib/wordpress/wp-content>
Options FollowSymLinks
Require all granted
</Directory>
murmillosoftware.com.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName murmillosoftware.com
ServerAlias www.murmillosoftware.com
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Forgot to restart my apache service. It is working now.
Solution
Do you notice the <VirtualHost *:80>
in your murmillosoftware.com.conf
file? That is called the Virtual Host configuration. In your current blog.murmillosoftware.com.conf
, all you're doing is creating an alias to /wp
path, which is why you're able to browse wordpress there.
Update your blog.murmillosoftware.com.conf
as follows (might be buggy, keep checking server logs):
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName blog.murmillosoftware.com
DocumentRoot /usr/share/wordpress
# Custom log files, to differentiate from root server
ErrorLog ${APACHE_LOG_DIR}/error-wordpress.log
CustomLog ${APACHE_LOG_DIR}/access-wordpress.log combined
Alias /wp-content /var/lib/wordpress/wp-content
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
</Directory>
<Directory /var/lib/wordpress/wp-content>
Options FollowSymLinks
Require all granted
</Directory>
</VirtualHost>
Answered By - hjpotter92 Answer Checked By - Pedro (WPSolving Volunteer)