![]() 1.2.4 Creating a Link in the Ubuntu Menu.Hosting multiple local dev sites on Ubuntu Testing PHPĬreate a new file in “scratch.localdev/htdocs” called “ info. You can now point your browser at and to check you’ve got two independent dev sites. ![]() Then go to the “Manage Servers” tab and start the Apache Web Server. If the XAMPP Control Panel isn’t already running, start it now. ![]() Ĭhange the contents of the title and h1 tags so they show the name of the site’s containing folder (e.g. We’ll delete these files later, so they don’t need to be fancy or complete. New we just create simple HTML files in our project “htdocs” folders. Enter this into the to create the basic folder structure: # Create the main folder for vhosts and move it into XAMPP's folder Next we need to create some folders and files so we can start serving content. Save that and close the text editor to get back to the terminal. # Each site needs a ServerName that matches an entry in /etc/hostsĭocumentRoot "/opt/lampp/vhosts/scratch.localdev/htdocs"ĮrrorLog "/opt/lampp/vhosts/scratch.localdev/log/error.log"ĬustomLog "/opt/lampp/vhosts/scratch.localdev/log/access.log" commonĭocumentRoot "/opt/lampp/vhosts/my-client.localdev/htdocs"ĮrrorLog "/opt/lampp/vhosts/my-client.localdev/log/error.log"ĬustomLog "/opt/lampp/vhosts/my-client.localdev/log/access.log" common # All our websites are stored in sub-directories under here. Sudo gnome-text-editor /opt/lampp/etc/extra/nfĬompletely replace the contents of the file with this: # Create Apache virtual hostsĮdit the vhosts sub-configuration file as root by typing this into your terminal: # Edit the XAMPP Apache virtual hosts configuration file as root Save those changes and close the text editor to return to the terminal window. Sudo gnome-text-editor /opt/lampp/etc/nfĮnable Virtual Hosts: Enable the “virtual hosts” sub-configuration file by removing the “#” at the beginning of that line: Enable Apache’s vhosts sub-configuration file # Edit the XAMPP main Apache configuraiton Paste the following into a terminal window to edit the core configuration as root. XAMPP’s Apache configuration has a core configuration file, and several sub-configuration files. Press CTRL C to stop the ping command from running. You should see a response that confirms a response from “127.0.0.1”, like this: 64 bytes from localhost (127.0.0.1): icmp_seq=7 ttl=64 time=0.043 msĦ4 bytes from localhost (127.0.0.1): icmp_seq=7 ttl=64 time=0.043 ms Save that, close the editor, go back to your terminal and test that it works: # Check that hostname lookups are working You can change the host names to suit your projects, and you can add as many as you like: # Type the following into a terminal to edit your system’s “hosts” file: # Edit the system's hosts fileĪdd the following lines to the end of the file. This means we can add custom lookups in here for our development projects. When your computer tries to convert a host name into an IP address, it first checks a local file called “/etc/hosts” (before trying DNS). You can launch XAMPP on Ubuntu using a Desktop Launcher Configure host name lookups Log out of your desktop session, then log in again so “sktop” is picked-up by Gnome and added to the menus. InformationNotice that the command to run the XAMPP Control Panel is defined by the “Exec” line, and we prefix it with “sudo” so the program runs as root. Then add the following text, save the changes then close the text editor: Ĭomment=Use the XAMPP Control Panel to start/stop Apache & MySQL servicesĮxec=sudo /opt/lampp/manager-linux-圆4.run Sudo gnome-text-editor /usr/share/applications/sktop Paste the following into your terminal window and press Enter # Create an application launcher for XAMPP A desktop launcher is just a small text file that tells Gnome how to start XAMPP. To tidy things up, we’ll create a desktop launcher so you can pin it to the Dash. Exit the installer to go back to the terminal window. When it’s finished installing, uncheck the option to “Launch XAMPP” – we don’t want to run it yet. InformationAlthough the application is called the XAMPP Control Panel, it installs to a folder called “/opt/lampp” for historic reasons. The installation wizard doesn’t have much in the way of choice, so accept the defaults and finish the wizard to install it to “/opt/lampp/”. …and then run the installer file as root by using “sudo”, like this: # Run the downloaded file as root to start the installation ![]() Open a terminal and type the following so we can execute the installer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |