Create a Local Development Environment using XAMPP in Ubuntu/Linux

June 25, 2007 – 11:16 pm

Goals

  • Create a local testing environment for ThemBid.com development in Ubuntu
  • Use XAMPP
  • Access from inside VMware for IE testing
  • Access directories locally without the files needing to be under the root htdocs directory


Steps

  • Downloaded and follow the instructions on the XAMPP website. The directories I use below assume you use the default installation, if not, adjust accordingly.
  • ifconfig
    • Write down the IP address for eth0, you will need it later
  • Run sudo /opt/lampp/lampp security to add better security as suggested on the XAMPP website.
  • sudo vi /opt/lampp/etc/httpd.conf
    • Add the following at the end:
      • Include etc/extra/httpd-vhosts.conf
      • Include etc/extra/httpd-default.conf
  • sudo vi /etc/hosts
    • Here you will define any servers you want to use as aliases, ie. 127.0.0.01   localserver (that allows you to type in localserver in your web browser instead of localhost, later you will have several of these as you add more sites).
  • sudo vi /opt/lampp/etc/extra/httpd-vhosts.conf
  • Setup a entry for each local site using the following template (comment the dummy examples and the NameVirtualHost):

NameVirtualHost [name of server, the one you set up in the /etc/hosts file]
NameVirtualHost [local IP (the external IP should forward to this if you are using a router)]

<VirtualHost [name of server] [local IP]>
  ServerName [name of server]
  DocumentRoot “[path to root of the local website]“
  <Directory “[path to root of the local website]“>
    AllowOverride All
    Allow from All
  </Directory>
</VirtualHost>

  • sudo /opt/lampp/lampp start
  • You should be able to access now locally by typing http://[name of server] or remotely using http://[local IP] if you are on the local network.

Note: if you have trouble accessing, try clearing your browser cache.

Post a Comment