Posts tagged Apache

How to bind Vagrant to port 80 on OS X

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 Vagrantfile:

config.vm.network "forwarded_port", guest: 80, host: 80

And boot up Vagrant as sudo:

sudo vagrant up

How to start and stop Apache in OS X

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 and stop Apache 2 in Ubuntu Linux

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).

How to set up a new virtualhost domain in Apache 2

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:

mkdir /var/www/my-new-website.com
more...

My minimal Apache2 virtualhost file

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.

more...