# Almost any Apache directive may go into a VirtualHost container. So, open the file /Applications/XAMPP/xamppfiles/etc/extra/nf. Virtual hosts in XAMPP are configured in the nf file and not the usual nf file. We need to add a line to the end of this file for each virtual host we want to configure. # localhost is used to configure the loopback interface In the example I’m going to configure a virtual host for a site that has a root folder of /Users/steve/Sites/MySite1/ and I’ll name the virtual host local.mysite1.Įnsure you stop XAMPP’s Apache server before editing either of the files below. Smultron is free and whilst no longer under development works under 10.5.8. files and will ask for authentication if required. Sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hostsĪn alternative is to use an editor like Smultron which has an option from the File menu to Open Hidden. To edit this file you can open TextEdit with root privileges from a Terminal window like so. The /etc/hosts file is hidden and a standard or admin user doesn’t normally have write access to it. Update: A new version of MAMP (1.8) was released in September 2009. I’m assuming that you’ve not already added virtual hosts to the /etc/hosts file for a previous MAMP install. These are /etc/hosts, /Applications/XAMPP/xamppfiles/etc/nf and /Applications/XAMPP/xamppfiles/etc/extra/nf. With XAMPP we need to edit 3 files as opposed to only the 2 with MAMP. So, there is no alternative but to do it manually. Unlike the Pro version of MAMP, XAMPP doesn’t have a nice GUI to allow virtual hosts to be configured easily. XAMPP provides a similar local server environment to MAMP, but configuring virtual hosts is a little different. Thinking that maybe the writing was on the wall for MAMP I started looking for an alternative and came across XAMPP. More recently I noticed that MAMP hadn’t been updated in nearly a year and their support forum resembled a wilderness. Your laravel project should be up and running there.A while back I posted about configuring virtual hosts in MAMP. Now start/restart your apache server and visit laravel.test in your preferred browser. ĭocumentRoot "C:/xampp/htdocs/your_project/public" Find the nf file in your Apache’s conf directory, e.g.: C:\xampp\apache\conf\extra\nf, open it, paste the following lines and save it. The specific folder is your Laravel project’s public directory. Server to load the contents of a specific folder when someone requests Now we will create a virtual host in Apache and we will instruct our Don’t worry, will remain available as well. 127.0.0.1 laravel.testīy doing this we tell Windows to direct laravel.test domain to our localhost. Go to the following folder C:\Windows\System32\drivers\etc and open the hosts file, paste the following line and save it. We will use laravel.test in this tutorial. Now dream a custom domain for your project. □Ĭustom domain for your Laravel project on localhost Once you complete this tutorial, you don’t have to type php artisan serve anymore, at least. Among many nice features, it handles multiple tabs, remembers the directory where you were last time and supports copy paste properly. To make your life easier, I would like to recommend you a better, free terminal tool instead of the default Windows cmd interface. But since many modern dev tools require typing commands in terminal (e.g.: NodeJS, Composer), you’ll have to get used to them inevitably. Now, use the installer, it will set up your PATH so that you can call composer from any directory in your command line.įor people who use XAMPP or something similar for web development, Laravel’s command line installs and operations might be repulsive in the beginning. Installed, which is a dependency manager for PHP. This tutorial starts from the point where Apache, MariaDB/MySQL and
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |