Categories
Uncategorized

XAMPP VM

Xampp vm is great out of the box, but let’s try to push it some more.

This is this setup:

  • Download and install XAMPP VM for Mac
  • SSH into the box (button ‘Open Terminal’ on front page). Now we have a terminal on the client. The following commands are in this terminal.
  • Create a new folder /opt/my-lampp
  • cd /opt/my-lampp, mkdir default, mkdir -p projects/project1
  • chown -R daemon:daemon my-lampp
  • Using vim, create a index.html in /opt/my-lampp/default with only text ‘default’ and /opt/my-lampp/projects/project1 with only text ‘project1’
  • Install vim: apt-get update, apt-get upgrade and then apt-get install vim.
  • vi /opt/lampp/etc/httpd.conf, uncomment ‘ Include etc/extra/httpd-vhosts.conf’ (remove #).
  • Save 😡
  • vi /opt/lampp/etc/extra/vhosts.conf and match the following. Be careful , these settings will also prevent 404’s when using laravel etc. So don’t skip directory permissions.

save using 😡

Now edit ftp settings. vi /opt/lampp/etc/proftpd.conf and change /opt/lampp/htdocs to /opt/my-lampp (file contains 2 entries)

On your host (your mac, not the xampp terminal), create a mapping for dev.project1 in /etc/hosts. You need ‘sudo vi /etc/hosts’.

My Xampp runs on 192.168.64.4 (yours might end different, Xampp shows IP on ‘General’). Add one extra lines in /etc/hosts for the new sites.

Now from host restart the services (services tab in Xampp)

Browse to http://192.168.64.4, this should show ‘default’. Browse to http://dev.project1. This shows ‘project1’. You can add more and more virtualhost projects to the server using the same procedure.

Install filezilla and create a new connection to 192.168.64.4:21. User daemon, password xampp. You will land into /opt/my-lampp as the root of the ftp.

Lets install wordpress. Download and unpack wordpress. Connect Filezilla and put the unpacked wordpress inside /default. When uploading is finished, wordpress to the name of your site.

Browse to localhost:8080 (enable Network->port forwarding in Xampp) and go to phpmyadmin. Create a database.

Browse to http://dev.default/wordpress. Install. DB user is root, password will be empty. Just enter the info and you’re done.

Leave a Reply

Your email address will not be published. Required fields are marked *