Archive for August, 2007

602 Part V (Web hosting comparison) . Running Servers Editing Your

Wednesday, August 1st, 2007

602 Part V . Running Servers Editing Your Apache Configuration Files The configuration files for Apache HTTPD are incredibly flexible, meaning that you can configure the server to behave in almost any manner you want. This flexibility comes at the cost of increased complexity in the form of a large number of configuration options (called directives), but in practice there are only a few directives with which you ll need to be familiar. See http://httpd.apache.org/docs/ for a complete list of directives supported by Apache. The Apache configuration is stored in text files that are read by the Apache server, beginning with /etc/apache/httpd.conf. Configuration is read from start to finish, with most directives being processed in the order in which they are read. Additional files may also be read based on the AccessConfig, ResourceConfig, and Include directives. On modern installations, the AccessConfig and ResourceConfig options point to empty files, and the traditional contents of those files have been moved to the main httpd.conf file. The Include directive is distinct from AccessConfig and ResourceConfig in that it can appear more than once and can include more than one file at a time. Files referenced by Include directives are processed as if their contents appeared at the location of the relevant Include statement. Include can point to a single file, to a directory in which all files are read, or to a wildcard that specifies a specific set of files within a directory. Subdirectories are also processed when Include points to a directory. The scope of many configuration directives can be altered based on context. In other words, some parameters may be set on a global level and then changed for a specific file, directory, or virtual host. Other directives are always global in nature, such as those specifying which IP addresses the server listens on, and some are valid only when applied to a specific location. Locations are configured in the form of a start tag containing the location type and a resource location, followed by the configuration options for that location, and finishing with an end tag. This form is often called a configuration block, and looks very similar to HTML. A special type of configuration block, known as a location block, is used to override settings for specific files or directories. These blocks take the following form: (options specific to objects matching the specifier go within this block) Note Note
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

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

Wednesday, August 1st, 2007

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.