Skip to content

Instantly share code, notes, and snippets.

@lozadaOmr
Last active August 29, 2015 14:01
Show Gist options
  • Save lozadaOmr/b36ab3a05aef6bb01fea to your computer and use it in GitHub Desktop.
Save lozadaOmr/b36ab3a05aef6bb01fea to your computer and use it in GitHub Desktop.

APACHE

Start apache server

sudo service apache2 start

Stop apache server

sudo service apache2 stop

Reloads apache config

-- used usually when something change in settings, eg. new virtual host.

sudo service apache2 reload

Restarts apache

sudo service apache2 restart

MYSQL

Starts mysql

sudo service mysql start

Stops mysql

sudo service mysql stop

Login as root

mysql -u root -p
(press enter, prompt for password)

Setup

editing Host file

sudo nano /etc/hosts

Format follows ip -> host name

eg:

192.168.33.10 mw

192.167.33.11 himmax

This means when you enter "mw", the browser will look for 192.168.33.10 - note it is more important to now the 'host name'

CREATING virtual host

first enable apache rewrite module, and vhost_alias

sudo a2enmod rewrite
sudo a2enmod vhost_alias

creating the virtual host

cd /etc/apache2/sites-available/
sudo nano mw.conf

mw.conf

-- note mw is the same name we input in /etc/hosts

-- SYNTAX: 'hostname'.conf

-- himmax.dev.conf, directowner.conf,

<VirtualHost *:80>
    DocumentRoot /var/www/mw/public
    ServerName  mw
</VirtualHost>

enable virtual host

sudo a2ensite mw.conf

You can view it in

mw/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment