Posts tagged Apache
First, stop Apache. Apache listens on port 80. If it's running, Vagrant won't be able to bind a VM to listen on port 80.
Then, just add a forwarded port to your
config.vm.network "forwarded_port", guest: 80, host: 80
And boot up Vagrant as
sudo vagrant up
How to start Apache:
sudo apachectl start
How to stop Apache:
sudo apachectl stop
How to restart Apache:
sudo apachectl restart
N.B. I am on OS X Mavericks. It ships with Apache 2.
How to start Apache 2:
sudo service apache2 start
How to stop Apache 2:
sudo service apache2 stop
How to restart Apache 2:
sudo service apache2 restart
How to reload Apache 2:
sudo service apache2 reload
Reloading is useful if you change a virtualhost file, since it will not actually stop Apache. Therefore, your websites will not go offline (even for a few seconds).
Whenever I upload a new folder to my website, I set its permissions and ownership:
sudo chmod -R g+rw /var/www/my-website.com/new-folder/ sudo chown -R www-data:www-data /var/www/my-website.com/new-folder/
This guide will show you how to quickly set up a new website in Apache 2 using virtualhosts. Follow these instructions exactly as written, down to the character: trailing slashes, case, line breaks, etc.
Start by firing up a terminal, and creating a folder for the new website:
I have written at length about how administering a Linux server is a nightmare. It does not matter how smart, experienced, or nerdy you are. Everyone who uses Linux bangs their head against a wall from time to time.