When ready, just copy it over to the production side. If you don’t have a separate development server just create another directory or hostname to the same server the production version is going and create another database for the development version. When it comes to development, developing PHP and hosting it on your desktop seems like a stupid idea (if there are multiple developers involved). I’ve usually enjoyed watching these videos, even if I can’t learn anything new, but because they usually provide new perspectives to things.īut I’m sorry to say that this one was a total let down. It’s just safer to “sandbox” it, so that if you host a site online on your machine, somebody finds an exploit on MySQL or you give them too much access, at least they can’t access your personal files. Oh, and that warning about running MySQL as your current user rather than creating a new user for it. You can’t call yourself a plumber either without knowing how to use PVC cement. Just enable PHP on apache by uncommenting “LoadModule php5_module libexec/apache2/libphp5.so” on /etc/apache2/nfĪnd start “web sharing” (aka Apache) in system preferences (or as any normal developer would do: run apachectl restart as root).Īnd for MySQL, Oracle provides a really simple GUI tool for Mac if you’ve got some problems and can’t use the command line.Īnd if you really can’t do this basic stuff, like configuring an Apache/Lighttpd or any httpd without using some GUI, you are not allowed to call yourself a developer. It’s like paying for fresh air, just because it’s in a shiny plastic bag. That is just paying for open source software wrapped in a fancy GUI. Why would anyone need a software like this, or at least pay for it?! Mac OS X has Apache and PHP 5 built-in since Snow Leopard (or Leopard even? And in older versions, it’s stupid easy to install). So you can use that folder the same as you would on your server – dropping in WordPress files, etc. Then all you need to do is create your directory in the htdocs folder, in my case: sandbox.local – and you can type “sandbox.local” into your browser and it will head directly to that directory. This is your hosts file, from here type in:Īnd then hit Ctrl + x to close the file. conf extension on the end of the file you create.įrom there – open up your Terminal and type in: In this case, I would then save this file as ‘’ into the ‘vhosts’ folder that you created earlier, where you need a. ALSO – I used a directory of ‘sandbox.local’ for this example, you’ll want to change it for whatever you’re calling your site, ex: css-tricks.local, mysite.local, etc. *** the htdocs folder is the default used for MAMP, you can change this in preference, however – if you do so you’ll have to change the directory in this file. Options Indexes FollowSymLinks MultiViews Now open up your text editor and enter this:ĭocumentRoot /Applications/MAMP/htdocs/sandbox.local/ Include /Applications/MAMP/conf/apache/vhosts/*.confįrom there, create a folder in that same apache directory called ‘vhosts’. Navigate to the bottom of the file where it says: “# Section 3: Virtual Hosts”, specifically: “# NameVirtualHost *” Head to your /Applications/MAMP/conf/apache folder, and open the file called: nf in your text editor. So all of my sites, I type in: sitename.local in my browser One of the things I’ve done for a while now is to create virtual hosts so that I can enter a domain into my browser. If it was running as So if you ever open port 8888, think about this ) He get a file in your htdocs folder and runs this command A let’s say cacker finds your server and deiced to have fun. Because if you run apache as a different users as your own account all of your files are always safe.Īn little example: Running as your own user. (i’ve had a lot of time i just got a 502 error because the files had the wrong owner) However in hosting or even server that are accessible to the Internet this is a need. In local testing this can really be a pain. Becasue the user running apache has to have at least read rights and some times write rights on all files in your htdocs folder. I believe the user the apache user runs as also determains the right apache has ( as in read/write). So if i’m wrong on the next bit please correct me. Now i don’t own a mac so don’t have the ability to know if this is the same as on linux but i think it on basic level is. In the video you had a comment about the apache user box.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |