Deploying Suse Linux Enterprise Server
| Purchase "Deploying Suse Linux Enterprise Server" at Lulu.com |
Apache Web Server
- SLES Configuration Layout
- The Yast Apache Wizard and Configuring Apache
- Creating Virtual Hosts
- Apache Authentication Techniques
- Using MySQL with Apache
Using MySQL with Apache
One of the most popular ways to create applications using Apache is to utilize what is called "LAMP". This acronym stands for Linux, Apache, MySQL and PHP and represents the integration of all of these entities to form the basis of a web platform.
Installing the Required Software
The basic software components that are needed to integrate MySQL into your existing Apache/PHP configuration can be installed by selecting the "Web and LAMP Server" pattern within the Yast Software Management Module, with the exception of "php5-mysql" package. To install this package, simply run "yast -i php5-mysql" as root.
There are also quite a few additional packages available within the Suse Linux Enterprise installation media that may be beneficial to your site (most of these are in the form of PHP Plugins) and different web applications may require additional software to be installed.
Configuring MySQL & Creating a Database
Once the software is installed, ensure that MySQL is running (and will start upon boot-up) and that you change the "root" password. To do this run the following:
rcmysql start chkconfig mysql on mysqladmin -u root password your_p@ssword
Now to create a database within MySQL, run the following:
mysql -u root -p
This will prompt you for your password, then log you into the MySQL monitor. Create a database with (the second and third lines should be entered as one command:
create database dbname; grant create, select, insert, update, delete, alter, lock tables on dbname.* to 'mysqluser'@'localhost' identified by 'users_p@ssword'; flush privileges; \q
You can now install any web application onto your server utilizing the database you just created with the above steps.
Backing up and Restoring a MySQL Database
Once you have your MySQL Database initialized and all of the data your application requires added to it, you now need to look at backing up the database. Fortunately, MySQL includes a very easy to use command line utility, mysqldump, that will pretty much automatically backup the database to a file. To use it, simply run something similar to:
mysqldump -u username --password=p@ssword dbname > /srv/backup/backup.sql
It is highly recommended that you include this command within a daily cron job so that your databases are backed up regularly.
If you ever need to restore your database, make sure you recreate the database using the steps from the previous section, then simply utilize something similar to:
mysql -u username --password=p@ssword dbname < /srv/backup/backup.sql
| Purchase "Deploying Suse Linux Enterprise Server" at Lulu.com |





