Installing a LAMP (Linux, Apache, MySQL, PHP) pack for Mandriva

Configuring urpmi

Let's start by configuring urpmi, Mandriva's packet management system.

Read this page from the Mandriva documentation for details.


First, delete the old sources (in root)

urpmi.removemedia -a

and then add the urpmi sources for Mandriva 2008 (still in root) : (these following mirrors were chosen with regard to my geographical location, but you're advised to choose your own here)

urpmi.addmedia main ftp://fr2.rpmfind.net/linux/Mandrakelinux/official/2008.0/i586/media/main/release with media_info/synthesis.hdlist.cz
urpmi.addmedia --update main_updates ftp://fr2.rpmfind.net/linux/Mandrakelinux/official/2008.0/i586/media/main/updates with media_info/synthesis.hdlist.cz
urpmi.addmedia contrib ftp://fr2.rpmfind.net/linux/Mandrakelinux/official/2008.0/i586/media/contrib/release with media_info/synthesis.hdlist.cz
urpmi.addmedia --update contrib_updates ftp://fr2.rpmfind.net/linux/Mandrakelinux/official/2008.0/i586/media/contrib/updates with media_info/synthesis.hdlist.cz

Then, you'll need to update the system:

urpmi --auto-select


Installing Apache

This is easy thanks to urpmi - if you know what to install, of course:

urpmi apache-base
urpmi apache-conf
urpmi apache-modules

Then launch Apache

/etc/init.d/httpd restart

Then go to your server's IP address using your web browser. Normally: It works!

You can then edit a nice index.html page on your computer, so we can upload it to the server.

Change permissions on the /var/www/html folder, because it initially belongs to root:

chown user /var/www/html

Upload the index.html page using SFTP.

Go to the folder of your hard drive where you've left the page and then log on to your server in SFTP:

sftp user@IPaddress
password *********

And upload the page with the following command

put ./index.html /var/www/html
quit

Check the server's address in your web browser again… you should be seeing the page you just uploaded!


Installing MySQL

Update the medias:

urpmi.update -a

Update the system:

urpmi --auto-select

Installing MySQL with urpmi:

urpmi mysql

Keep the official MySQL documentation about, it's always useful!

Launch MySQL

/etc/init.d/mysqld restart

MySQL passwords have no link whatsoever to the system passwords, so the root login referred to here is not the same as your system root user. This is a specific root user for MySQL.

Connect to MySQL in root (no password for the time being):

shell> mysql -u root

Drop anonymous users:

mysql> DROP USER ''; //None on my server!

Adding a local access password for root:

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('your_password');

Let's quit MySQL (to log on again and check the configuration account):

mysql> quit

Connect to MySQL (with a password this time):

shell> mysql -u root -p Enter password: * …

Adding a remote access password:

mysql> SET PASSWORD FOR 'root'@'your_server' = PASSWORD('your_password');

There you go! You've successfully configured LAMP modules for your brand new Mandriva server! Feel free to experiment, and add to the Gandi wiki with more tutorials to share your discoveries. :)


最后更改: 2016/06/08 08:47 (外部编辑)