Create a Local Development Environment using XAMPP in Ubuntu/Linux

Posted by thinkingserious on Jun 26, 2007 1:37 AM EDT
ThemBid.com; By Elmer Thomas
Mail this story
Print this story

This solution allows you to access your local development sites from within a guest VMware installation (for IE testing) and also securely remotely.

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.

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Linux, Ubuntu

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.