| Install mysql for Apache (Fedora 12) |
|
| sysadmin |
Prerequisites:Apache and php is already installed (see http://www.madmadmod.com/sysadmin/16-setting-up-a-very-simple-apache-webserver-on-linux-fedora.html and http://www.madmadmod.com/sysadmin/52-install-php-for-apache-fedora-12.html for more details) Step 1: Install packagesrun the following command as root:
Step 2: start mysqld and restart apache
run the following command as root to start mysqld:
If you want mysqld to start at boot time:
now restart apache:
Step 3: set mysql-root password
set a new mysql-root password:
Step 4: create a test database
Start the mysql command-line tool: and create a new database (e.g. "test"):
Select the new database: and create a new table (e.g. example): and insert some values:
Step 5: Testgo to the "html" directory (default is /var/www/html):
and open a new file called "test.php"
write the following PHP code into that file and save & close the file with ":wq" Now open a browser window and go to "http://localhost/test.php" or "http://127.0.0.1/test.php" or whatever your URL is.
SELinuxIf You have SELinux enabled you have to make sure the security context of your new file is "httpd_sys_content_t". run "ls -laZ" to check the security context:
If it is NOT httpd_sys_content_t you can restore the context with restorecon:
Comments (0)
Powered by !JoomlaComment 4.0 beta1
!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved." |


