Skip to content

Instantly share code, notes, and snippets.

@ozooxo
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozooxo/df4a28f40e0f52ed2909 to your computer and use it in GitHub Desktop.
Save ozooxo/df4a28f40e0f52ed2909 to your computer and use it in GitHub Desktop.
setup apache2 server on ubuntu 14.04
beta@landlubber:~$ sudo apt-get install apache2
beta@landlubber:~$ sudo chown -R beta:beta /var/www/
beta@landlubber:~$ sudo chmod -R 777 /var/www/

beta@landlubber:~$ mkdir -p /var/www/dooqee

It seems that a local folder, e.g., /home/beta/Documents/localhost/rails doesn't work. I guess that's because apache2 doesn't have permission to read user files. I don't quite know how to set that up.

beta@landlubber:~$ sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/dooqee.conf
beta@landlubber:~$ sudo gedit /etc/apache2/sites-available/dooqee.conf

and add

ServerAdmin webmaster@dooqee.local
ServerName dooqee.local
ServerAlias www.dooqee.local
DocumentRoot /var/www/dooqee/

Probably I need to first sudo a2dissite dooqee.conf if I already a2ensite it before.

beta@landlubber:~$ sudo a2ensite dooqee.conf
beta@landlubber:~$ sudo service apache2 restart
beta@landlubber:~$ sudo gedit /etc/hosts

and add one line

127.0.0.1   localhost
127.0.1.1   landlubber
127.0.0.2   dooqee.local # <--- this line

I am not exactly sure the order of doing service apache2 restart and edit /etc/host; probably the computer need to be restart once. Also, it seems that any local IP which is not occupied just works.

Install the relevant mysql and php packages.

Change the lines similar to this one

define("DatabaseUser", "root");
define("DatabasePassword", "");
define("DatabaseName", "dooqeene_data");

in php souce file.

Import the original sql database

$ mysql -u root -p
mysql> CREATE DATABASE dooqeene_data;
mysql> Exit
$ mysql -u root dooqeene_data < dooqeene_data.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment