Replicating a Web Server environment
fyi: You do not need install XAMPP locally if you only intend to work with online web hosts. But installing locally is good to learn and clone websites.
Advertisement:
Desktop operating systems (Windows and OSX) lack the web server technologies to replicate a Web server but you can easily install this software with the XAMMP software bundle from https://www.apachefriends.org/index.html
XAMPP is a completely free, easy to install Apache distribution containing MySQL, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and to use.
Go to https://www.apachefriends.org/index.html and Download the XAMMP version to match your operating system (Windows, Linux or Mac OSX).
Installing XAMPP on Mac OSX
- Goto https://www.apachefriends.org/index.html
- Click XAMMP for OSX
- Wait for the file to download (it is about 136MB).
- Open the download file and Run the XAMPP.app
- Click Next
- Select the following components “XAMPP Core Files” and “XAMPP Developer Files”.
- Note: XAMPP will be installed to “/Applications/XAMPP”.
- Un tick the Bitnami checkbox and click Next.
- Click Next
- Wait for XAMPP to Install.
- Launch XAMPP
- Done
- fyi: Read the Using XAMPP on your local PC guide.
fyi: Installing XAMPP –OSX FAQ
Now you will have a web server that you can use local to make and edit websites or install WordPress into.
Setting Mac web server permissions
- By default XAMPP installs to “/Applications/XAMPP/xamppfiles/htdocs” but for security reasons permissions are not set on the folder. Follow these steps to setup permissions on your site.
- You can save web page content to the main site (“/Applications/XAMPP/xamppfiles/htdocs”) or setup separate virtual sites (guide here).
Optional Advanced: Creating virtual web servers and set web server permissions
If you do tho want to save to the “/Applications/XAMPP/xamppfiles/htdocs” folder or if you plan on hosting many sites on your XAMPP installation and prefer to setup a separate (virtual) folder for each site you can follow these instructions. Saving separate web projects to separate virtual folders is a good idea is you use a SVN backup program like Cornerstone SVN.
- Decide where you want to place your additional virtual web server folder (e.g “/Users/Simon/CornertoneSVNWorkingCopies/WebProject001”) and create that folder.
- Open a Mac Terminal Window
- Type “/Users/Simon/CornertoneSVNWorkingCopies“.
- Type “sudo chmod -R ugo+rwx “WebProject001/”” to grant all full read/write access to all groups.
- Type “sudo chmod -R o-w “WebProject001/”” to remove permissions from the “other” group to write files.
- Stop any running web servers in the XAMPP Control Panel
- Type “sudo nano /Applications/XAMPP/xamppfiles/etc/httpd.conf“
- In the Sudo text editor press “CTRL+W” then type “Virtual Servers” and press “ENTER” to jump to the virtual servers location.
- Add the following line below the Virtual Hosts line (on a new line) “Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf”
- Press Ctrl+O then Ctrl+X to exit the editor.
- Now in the terminal type “sudo nano /Applications/XAMPP/etc/extra/httpd-vhosts.conf“
- Comment out the existing sample virtual hosts (add a # in front of the lines below)
- Add the following text to the bottom of the http-vhosts.conf to configure/add your new virtual host.
- Save the http-vhosts.conf file.
- Note: You can add as many virtual hosts as you like (e.g “Web_Project_001”, “Web_Project_002”, “Web_Project_003” etc). As you can see this is a lot tidier than stuffing many sites in the one root folder in htdocs.
- Don’t forget to create a “_Logs” folder under “/Users/Simon/CornertoneSVNWorkingCopies/WebProject001/” (or your path) and apply write permissions (see above in step 4 and 5).
- Open your XAMPP Control panel and start your Apache Web Server service. If the service does not start check the XAMPP Control Panel Application log tab.
- Don’t forget to document your configuration.
- fyi: More help on creating virtual servers here
Installing XAMPP on Windows
- Goto https://www.apachefriends.org/index.html
- Click XAMPP for Windows
- Follow the download links and save the install file (it is about 112MB )
- Install XAMPP with Administrator rights (don’t install to c:\program files, install to “C:\xammp”)
- Follow the setup steps.
- Read the Using XAMPP on your local PC guide.
fyi: Installing XAMPP – Windows FAQ
Now you will have a web server that you can use local to make and edit websites or install WordPress into.
Installing XAMPP on Linux
fyi: Installing XAMPP – Linux FAQ
Please signup for our newsletter
[mc4wp_form]
Ask a question or recommend an article
[contact-form-7 id=”30″ title=”Ask a Question”]
Donate and make this blog better
Ask a question or recommend an article
[contact-form-7 id=”30″ title=”Ask a Question”]