Skip to content

Setup Local Server

anandr31 edited this page Feb 15, 2011 · 9 revisions
  1. To setup a local a local web server, you need to install Apache, MySQL & PHP ( > 5.3). You can install all at one go from any package mentioned at List of Apache–MySQL–PHP packages. If you are not sure of what to pick ,go with XAMPP because of ease of use & cross platform support. The next instructions assume you are using XAMPP, but they remain almost same for any package of your choice.
  2. Install XAMPP & test that its working by following the instructions on the download page. You need to navigate to http://localhost to view your current local site.
  3. You can install a Git Client as instructed in http://help.github.com/git-installation-redirect. For Windows, you need to download msysgit & for Linux, you need get use apt-get & install Git client. The next instructions are using the command line options (the most safest way & easiest way to document).
  4. Once you have installed the client, you need to setup SSH keys (preferably) or use https to commit changes. Please follow the instructions in the "Setup" section on http://help.github.com/
  5. To test you are SSH connection, run ssh [email protected] from the command line (Git Bash on Windows). If prompted about unknown server, answer as 'yes' to add it to authenticated server. The reply should say you're successfully connected to the server. It will also say that 'GIT doesn't allow access through shell' - which is alright.
  6. Once you are connected, run the following commands: `git clone [email protected]:lakshya/website.git' & 'git fetch'.
  7. This will get all files from the server onto your local machine anandr31: you can see the files in ~/Desktop/website/
  8. Adjust the 'httpd.conf' file to point your DocumentRoot to the www/ directory you just fetched from server. Restart the http server (apache), just in case. Now, you should be able to see the site at http://localhost/

anandr31: httpd.conf can be found in /opt/lampp/etc (or whichever default path is shown while installing your package - XAMPP for linux in my case). Also, restarting server is a must after changing the httpd.conf file. To restart the server, run the following on command line as root user (for linux XAMPP): /opt/lampp/lampp stop /opt/lampp/lampp start

  1. Anytime to update your files from the remote repository (github in our case), run 'git pull' anandr31: You must be in Desktop/website to do this
  2. You can make changes in the local code, commit them with 'git commit'
  3. To push your commits to the remote server, run 'git push'

I understand the steps aren't clear enough, so please also go through the below links to get a better understanding:

  1. http://gitref.org
  2. http://help.github.com

anandr31: After setting up my system I went to localhost and got the following error: The log directory is not writable: /home/anandr31/Desktop/website/www/application/logs FIX: change permission for /home/anandr31/Desktop/website/www/application/logs to allow write access. I did a 'chmod 777 /home/anandr31/Desktop/website/www/application/logs'

Clone this wiki locally