By benjaminADK
I have tried following every tutorial I can find and I can’t seem to get the WordPress one click setup to serve files from a different directory besides the default /var/www/html.
I have used a2dissite, a2ensite, reloaded, restarted apache. The properties in the config file ServerName, etc.
One interesting detail is that when I ran a2dissite 000-default.conf came back with an error to the effect that the corresponding file in sites-enabled was not symlinked. Which is weird since creating new .conf files in sites-available does seem to symlink them into sites-enabled. I have setup these files on other droplets and had no problems. Is this something unique to this pre configured droplet?
I scrapped my first droplet - I had deleted all the original default .conf files in frustration and apache was, in my opinion, still using one of them. It was looking for a directory that I had deleted, which though an error, but that directory was not pointed to in any of the configurations that were supposed to be active.
This is my /etc/apache2/sites-available/mydomain.conf file.
<VirtualHost *:80>
ServerAdmin ben@mydomain
DocumentRoot /var/www/html.old
ServerName mydomain
ServerAlias www.mydomain
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html.old/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
The only way I found to serve something else is to change the contents of /var/www/html. This is not ideal, since my next move is to get multiple sites running with subdomains. As of right now I am getting by but starting to get frustrated with the learning curve.
Any help would be greatly appreciated. Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
What I could suggest is the following:
apachectl -t
ls -l /etc/apache2/sites-enabled
tail -100 /var/log/apache2/error.log
/var/www/html.old folder:chown -R www-data:www-data /var/www/html.old
Let me know how it goes! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.