AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using itop.study. Set the 'ServerName' directive globally to suppress this message
#vi httpd.conf
#ServerName www.xxx.com:80
ServerName localhost:80
:wq
停止Apache:/usr/local/apache2/bin/apachectl stop
重启Apache:/usr/local/apache2/bin/apachectl restart
http://localhost
显示it works! 说明已安装完成。
# vi /etc/rc.local
追加/usr/local/apache2/bin/apachectl start以便开机自动开启apache服务
网站放在/usr/local/apache2/htdocs下;
如果网站的index后缀名是php的,则需要在/usr/local/apache2/conf/httpd.conf文件夹,增加index.php。
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
# mv mariadb-5.5.48-linux-x86_64 /usr/local/
# groupadd mysql
# useradd -g mysql mysql
# id mysql
uid=500(mysql) gid=500(mysql) groups=500(mysql)
# ln -s mariadb-5.5.48-linux-x86_64/ mysql
# cd mysql/
#cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
# ./scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
160227 0:23:45 [Note] ./bin/mysqld (mysqld 5.5.48-MariaDB) starting as process 1105 ...OK
Filling help tables...
160227 0:23:47 [Note] ./bin/mysqld (mysqld 5.5.48-MariaDB) starting as process 1112 ...OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
#cp support-files/mysql.server /etc/init.d/
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:
Alternatively you can run:
'./bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.
You can start the MariaDB daemon with:
cd '.' ; ./bin/mysqld_safe --datadir='/var/lib/mysql'
You can test the MariaDB daemon with mysql-test-run.pl
cd './mysql-test' ; perl mysql-test-run.pl
The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from MariaDB
Corporation Ab. You can contact us about this at sales@mariadb.com.
Alternatively consider joining our community based development effort:
http://mariadb.com/kb/en/contributing-to-the-mariadb-project/
# chown -R root .
# chown -R mysql data
# vi .bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin/:/usr/local/apache2/bin/:/usr/local/php/bin/
:wq
启动数据库:
#/usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --datadir=/usr/local/mysql/data --user=mysql &
设置开机自动启动数据库:
#vi /etc/rc.local
add
/usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --datadir=/usr/local/mysql/data --user=mysql &
:wq #reboot
修改mysql root密码:
#'./bin/mysqladmin' -u root password 'new-password'
or
# ./mysql_secure_installation
# ./mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.48-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
MariaDB [(none)]> use mysql;
Database changed
MariaDB [mysql]> show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| event |
| func |
| general_log |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| proxies_priv |
| servers |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
24 rows in set (0.00 sec)
MariaDB [mysql]> select host, user from user;
+--------------+------+
| host | user |
+--------------+------+
| 127.0.0.1 | root |
| ::1 | root |
| localhost | |
| localhost | root |
| php.myfamily | |
| php.myfamily | root |
+--------------+------+
6 rows in set (0.00 sec)
MariaDB [mysql]> update user set host='%' where user='root' and host='localhost';
Query OK, 1 row affected (0.05 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [mysql]> select host, user from user;
+--------------+------+
| host | user |
+--------------+------+
| % | root |
| 127.0.0.1 | root |
| ::1 | root |
| localhost | |
| php.myfamily | |
| php.myfamily | root |
+--------------+------+
6 rows in set (0.00 sec)
MariaDB [mysql]> delete from user where user='';
Query OK, 2 rows affected (0.03 sec) mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
#wget http://nchc.dl.sourceforge.net/p ... mcrypt-2.5.8.tar.gz # tar -zxvf 26-libmcrypt-2.5.8.tar.gz
# tar -zxvf libmcrypt-2.5.8.tar.gz
# cd libmcrypt-2.5.8
# ./configure && make && make install
# tar -zxvf 27-mhash-0.9.9.9.tar.gz
# tar -zxvf mhash-0.9.9.9.tar.gz
# cd mhash-0.9.9.9
# ./configure && make && make install
# cd /tmp/rpm/php-5.6.18/ext/mcrypt/
# phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
# ./configure && make && make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
#vi /usr/local/php/lib/php.ini extension=/usr/local/php/lib/php/extensions/no-debug-zts-20131226/mcrypt.so
:wq