Chapter 23 . Running a Linux, Apache, MySQL, (Web and email hosting)

Chapter 23 . Running a Linux, Apache, MySQL, and PHP (LAMP) Server 601 The installation scripts in the mysql-server package provide you with a couple of notices and ask whether you want to remove databases when purging the mysqlserver package. No is the safest option because it reduces the chance of accidentally losing your data. You also are asked whether you want the MySQL server to start on boot. You should probably say Yes here. Access to databases within MySQL is managed based on account information stored within the mysql database. As with UNIX systems, the superuser account is named root. The default installation does not set a password on this account, and it creates an anonymous account and a test database that should be removed unless you are certain that you need them: # mysql -u root mysql Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 3 to server version: 4.0.18-log Type help; or h for help. Type c to clear the buffer. mysql> UPDATE user SET Password=PASSWORD( newpassword ) -> WHERE User= root ; Query OK, 2 rows affected (0.00 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> DELETE FROM user WHERE User = ; Query OK, 2 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> DROP DATABASE test; Query OK, 0 rows affected (0.00 sec) mysql> q Bye The UPDATE command changes the password for the MySQL root account (replace newpassword with the password you want to use), the DELETE command removes the anonymous user, and the FLUSH command tells the running MySQL server to reload the list of user accounts from the database. Finally, the DROP command removes the test database. Operating Your LAMP Server With the components of your LAMP server installed and running, you are ready to configure Apache and try it out. For this example, Apache is set up to serve content for your own domain using a feature called virtual hosting, after which you ll see how to install the Gallery application (http://gallery.menalto.com), which enables you to create an online photo gallery on your LAMP server.
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Leave a Reply