PDA

View Full Version : LAMP Help (Noob)


sucafish
19th March 2009, 05:30 PM
Goal: To learn how to create a website using LAMP. Take completed website and port to a web server and run.

System I am currently running an HP Pavillion laptop 500G HD, 6G RAM, dual boot Fedora 10 and Vista.

Questions: How should I partition HD to allow functionality of LAMP and to later transfer to a online webserver.

I have read several different rational on partitioning the disk. Do I really need a /tmp, /var? Currently I have / /boot, /swap, /home, /usr. Is this okay to start? Will it make transferring the project more difficult for "official use?

Should I not use the laptop at all and create a separate machine for this purpose only?

Any good books on this subject?

Thanks guys.

Any additional comments would also be appreciated.

savage
19th March 2009, 05:37 PM
Goal: To learn how to create a website using LAMP. Take completed website and port to a web server and run.

System I am currently running an HP Pavillion laptop 500G HD, 6G RAM, dual boot Fedora 10 and Vista.Well, it all depends on how you work.

For example, do you want to develop the site in Fedora or Windows (i.e. do you need to use tools like Dreamweaver?). If so then dual-booting a web server is pointless, as you'd have to code up your site, reboot to Fedora to check it works etc. etc.

If you're planning on building entirely in Fedora, then a local web server for testing would be fine, 'yum install httpd mysql php-mysql' and away you go, then upload your files to the "official" server when you're happy with it.

Personally I develop in whichever OS I happen to be in at the time, so I run a separate local web server for development, which I can use from Windows or Fedora, and then have a production server with a hosting company.

Questions: How should I partition HD to allow functionality of LAMP and to later transfer to a online webserver.

I have read several different rational on partitioning the disk. Do I really need a /tmp, /var? Currently I have / /boot, /swap, /home, /usr. Is this okay to start? Will it make transferring the project more difficult for "official use? .If it's literally just a development system, then the default partitioning would be fine, just remember to keep backups of /var/www (that's where your web server root is) and /var/mysql (databases), as the default partitioning layout does not provide any redundancy.

sucafish
19th March 2009, 05:53 PM

Thanks for the info, I am really excited to get into this. How is the learning curve? I am brand new to all aspects of LAMP, but the back end or data base portion is what is really making my jimmy jump...

savage
19th March 2009, 06:14 PM
Thanks for the info, I am really excited to get into this. How is the learning curve? I am brand new to all aspects of LAMP, but the back end or data base portion is what is really making my jimmy jump...lol you sound like me when I first played with Fedora, I did it for the exact same reasons you are, I wanted a LAMP web server, but had never used Linux before, and it was setting up the LAMP that got me using Linux on the desktop.

For the backend, you want:

Apache (yum install httpd)
MySQL (yum install mysql)
PHP (yum install php php-mysql)
You already have Linux, Apache is your web server software, MySQL is your database, and PHP is the scripting language.

Once those are installed, you can install them all at once like:yum install httpd mysql php php-mysql, start the services and set them to start with the system:service httpd start
service mysqld start
chkconfig --level 35 httpd on
chkconfig --level 35 mysqld onThe service command starts the services, the chkconfig command sets them to load with the system, with runlevels 3 and 5 (--level 35).

Next create a file called test.php in /var/www/html and in it put:<?php
echo "PHP works! wahoo!";
?>Then point your browser to http://localhost/test.php and you should see in your browser "PHP works! wahoo!". :)

If you want graphical tools for working with MySQL databases, there's the MySQL Administrator and MySQL Query Browser:yum install mysql-query-browser mysql-administratorSee this tutorial (http://www.yolinux.com/TUTORIALS/LinuxTutorialMySQL.html) and skip down to Post Installation for setting up MySQL.

sucafish
19th March 2009, 08:51 PM
Thanks again for all of your help. Are you still at it? Making web pages that is?

savage
19th March 2009, 09:06 PM
No problem. :)

I was into web development before I had my Linux servers, using ASP and Microsoft kit. At the time, it was in the news about MS going the "rented computing" route, you pay £X per month to use Windows, that was the flipping point for me when I decided to give Linux everything, and finally switched.

I am still at it, although it's mostly a hobby for me, as with a lot of my IT stuff, I fear working in IT will ruin the fun I have tinkering with it.

JohnVV
20th March 2009, 03:40 AM
my best advice is NOT to use the rpm's for apache,myqsl,php ,phpmyadmin. But to install each one by hand and to configure them from there defaults and learn how to edit there config files .Then to set up the user and root accounts in mysql ,...

and do updates this way . You WILL lean them doing it this way
it will take time but so dose school.