Web server extensions - 601Chapter 23Running a Linux, Apache, MySQL, and PHP

601Chapter 23Running a Linux, Apache, MySQL, and PHP (LAMP) ServerThe installation scripts in the mysql-server package provide you with a couple ofnotices and ask whether you want to remove databases when purging the mysql- server package. No is the safest option because it reduces the chance of accidentallylosing your data. You also are asked whether you want the MySQL server to starton boot. You should probably say Yes here. Access to databases within MySQL is managed based on account information storedwithin the mysql database. As with UNIX systems, the superuser account is namedroot. The default installation does not set a password on this account, and it createsan anonymous account and a test database that should be removed unless you arecertain that you need them: # mysql -u root mysqlWelcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 3 to server version: 4.0.18-logType 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: 0mysql> 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> qByeThe UPDATEcommand changes the password for the MySQL root account (replacenewpasswordwith the password you want to use), the DELETEcommand removesthe anonymous user, and the FLUSHcommand tells the running MySQL server toreload the list of user accounts from the database. Finally, the DROPcommandremoves the test database. Operating Your LAMP ServerWith the components of your LAMP server installed and running, you are ready toconfigure Apache and try it out. For this example, Apache is set up to serve contentfor your own domain using a feature called virtual hosting, after which you ll see howto install the Gallery application (http://gallery.menalto.com), which enablesyou to create an online photo gallery on your LAMP server.
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Leave a Reply