阿里云CentOS6.5挂载数据盘以及搭建LAMP环境
系统约定
软件配置:
软件源代码包下载位置 |
/data/download |
|
|
/usr/local/src |
|
Apache 源码包编译安装位置存放 |
/usr/local/apache |
|
MySQL源码包编译安装位置 |
/usr/local/Centling/mysql |
|
PHP 源码包编译安装位置 |
/usr/local/Centling/php5 |
|
脚本以及维护程序存放位置(尚未使用) |
/usr/local/Centling/sbin |
|
MySQL 数据库存放位置 |
/data/mysql |
|
Apache 网站根目录 |
/data/www |
|
Apache 虚拟主机日志根目录 |
/data/log |
|
ftp数据目录 |
/data/ftproot |
一、更新yum源/下载安装包
1.查看系统默认安装的yum
[root@iZ281hdlfydZ yum.repos.d]# rpm-qa|grep yum
yum-metadata-parser-1.1.2-16.el6.x86_64
yum-plugin-fastestmirror-1.1.30-17.el6_5.noarch
yum-plugin-security-1.1.30-17.el6_5.noarch
yum-3.2.29-43.el6.centos.noarch
yum-utils-1.1.30-17.el6_5.noarch
2.备份yum源文件
[root@iZ281hdlfydZ yum.repos.d]# mv/etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[root@iZ281hdlfydZ yum.repos.d]# ls
CentOS-Base.repo.backup CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo epel.repo
3.获取163的yum源
[root@iZ281hdlfydZ yum.repos.d]# wgetmirrors.163.com/.help/CentOS6-Base-163.repo
--2015-07-03 11:17:10-- http://mirrors.163.com/.help/CentOS6-Base-163.repo
Resolving mirrors.163.com...123.58.173.185, 123.58.173.186
Connecting tomirrors.163.com|123.58.173.185|:80... connected.
HTTP request sent, awaiting response... 200OK
Length: 2006 (2.0K)[application/octet-stream]
Saving to: ?.entOS6-Base-163.repo?
100%[==================================================================================>]2,006 --.-K/s in 0s
2015-07-03 11:17:10 (311 MB/s) -?.entOS6-Base-163.repo?.saved [2006/2006]
[root@iZ281hdlfydZ yum.repos.d]# ls
CentOS6-Base-163.repo CentOS-Base.repo.backup CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo epel.repo
4.重命名
[root@iZ281hdlfydZ yum.repos.d]# mvCentOS6-Base-163.repo CentOS-Base.repo
5.建立缓存
[root@iZ281hdlfydZ yum.repos.d]#yummakecache
6.更新yum源
[root@iZ281hdlfydZ yum.repos.d]# yum update
安装包:
apr-1.5.2.tar.gz
apr-util-1.5.4.tar.gz
httpd-2.4.12.tar.gz
mysql-5.6.25.tar.gz
apr-iconv-1.2.1.tar.gz
cmake-3.2.3.tar.gz
libiconv-1.14.tar.gz
php-5.6.10.tar.gz
下载地址:
[root@iZ281hdlfydZ download]# wget http://php.net/get/php-5.6.10.tar.gz
[root@iZ281hdlfydZ download]#
wget http://www.webhostingjams.com/mirror/apache//httpd/httpd-2.4.12.tar.gz
[root@iZ281hdlfydZ download]# wget http://www.cmake.org/files/v3.2/cmake-3.2.3.tar.gz
[root@iZ281hdlfydZ download]#
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.25.tar.gz
[root@iZ281hdlfydZ download]# wget http://mirrors.cnnic.cn/apache//apr/apr-1.5.2.tar.gz
[root@iZ281hdlfydZ download]# wget http://mirrors.cnnic.cn/apache//apr/apr-util-1.5.4.tar.gz
[root@iZ281hdlfydZ download]# wget http://mirrors.cnnic.cn/apache//apr/apr-iconv-1.2.1.tar.gz
[root@iZ281hdlfydZ download]# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
二、挂在数据盘
1.查看分区
Linux的云服务器数据盘未做分区和格式化,可以根据以下步骤进行分区以及格式化操作。下面的操作将会把数据盘划分为一个分区来使用。
1、查看数据盘
在没有分区和格式化数据盘之前,使用 “df –h”命令,是无法看到数据盘的,可以使用“fdisk -l”命令查看。
友情提示:若您执行fdisk -l命令,发现没有 /dev/xvdb 表明您的云服务无数据盘,那么您无需进行挂载,此时该教程对您不适用
2、 对数据盘进行分区
执行“fdisk/dev/xvdb”命令,对数据盘进行分区;
根据提示,依次输入“n”,“p”“1”,两次回车,“wq”,分区就开始了,很快就会完成。
3、 查看新的分区
使用“fdisk-l”命令可以看到,新的分区xvdb1已经建立完成了。
4.格式化新分区
这个时候分区还没有挂载,CentOS6.5默认支持ext4的文件系统,如果不支持可以通过如下命令加载(
使用如下命令,可以完成模块加载过程。
cd/lib/modules/2.6.18-274.12.1.el5/kernel/fs/ext4
modprobe ext4
yum installe4fsprogs
)
使用ext4创建文件系统
[root@iZ281hdlfydZ~]# mkfs.ext4 /dev/xvdb1
5、添加分区信息
将新分区挂载到/data目录,可使用如下命令。注:如果/data目录不存在,需先运行命令”mkdir /data”创建该目录。
“echo'/dev/xvdb1 /data ext4 defaults 0 0' >> /etc/fstab”命令写入新分区信息。
然后使用“cat/etc/fstab”命令查看,出现以下信息就表示写入成功
使用“mount-a”命令挂载新分区,然后用“df -h”命令查看,出现以下信息就说明挂载成功,可以开始使用新的分区了。
三、安装MySQL
[root@iZ281hdlfydZ src]#tar zxvf cmake-3.2.3.tar.gz
[root@iZ281hdlfydZ src]# cd cmake-3.2.3
[root@iZ281hdlfydZ cmake-3.2.3]#./configure
[root@iZ281hdlfydZ cmake-3.2.3]# gmake&&gmake install
[root@iZ281hdlfydZ cmake-3.2.3]# groupaddmysql
groupadd: group 'mysql' already exists
[root@iZ281hdlfydZ cmake-3.2.3]# useradd -gmysql -s /sbin/nologin mysql
useradd: user 'mysql' already exists
[root@iZ281hdlfydZcmake-3.2.3]# mkdir -p /data/mysql
[root@iZ281hdlfydZ cmake-3.2.3]# chown -Rmysql:mysql /data/mysql
[root@iZ281hdlfydZ src]# tar zxvfmysql-5.6.25.tar.gz
[root@iZ281hdlfydZ src]# cd mysql-5.6.25
[root@iZ281hdlfydZ mysql-5.6.25]# make&& make install
[root@iZ281hdlfydZ mysql]# ./scripts/mysql_install_db--user=mysql
[root@iZ281hdlfydZ mysql]# cp./support-files/mysql.server /etc/rc.d/init.d/mysqld
[root@iZ281hdlfydZ mysql]# chkconfig mysqldon
basedir=/usr/local/Centling/mysql
[root@iZ281hdlfydZ Centling]# mkdir -p/usr/local/Centling/etc
[root@iZ281hdlfydZ mysql]# cp./support-files/my-default.cnf /usr/local/Centling/etc/my.cnf
[root@iZ281hdlfydZ support-files]# mv/usr/local/Centling/mysql/data/* /data/mysql
[root@iZ281hdlfydZ support-files]# servicemysqld start
[root@iZ281hdlfydZ Centling]#vi/etc/profile
[root@iZ281hdlfydZ Centling]#PATH=/usr/local/Centling/mysql/bin:$PATH
[root@iZ281hdlfydZ Centling]#export PATH
[root@iZ281hdlfydZ Centling]#source/etc/profile
[root@iZ281hdlfydZ Centling]#mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT ISRECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASEREAD EACH STEP CAREFULLY!
In order to log into MySQL to secure it,we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, thepassword will be blank,
so you should just press enter here.
Enter current password for root (enter fornone):
OK, successfully used password, movingon...
Setting the root password ensures thatnobody can log into the MySQL
root user without the proper authorisation.
Password updated successfully!
By default, a MySQL installation has ananonymous user, allowing anyone
to log into MySQL without having to have auser account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
Remove anonymous users? [Y/n] y
Normally, root should only be allowed toconnect from 'localhost'. This
ensures that someone cannot guess at theroot password from the network.
Disallow root login remotely? [Y/n] y
By default, MySQL comes with a databasenamed 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a productionenvironment.
Remove test database and access to it?[Y/n] y
-Removing privileges on test database...
Reloading the privilege tables will ensurethat all changes made so far
Reload privilege tables now? [Y/n] y
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
[root@iZ281hdlfydZ mysql]# cd/usr/local/Centling/mysql
[root@iZ281hdlfydZ mysql]# chown -Rmysql:mysql .
[root@iZ281hdlfydZ mysql]# chgrp -R mysql .
[root@iZ281hdlfydZmysql]# cd /data/mysql
[root@iZ281hdlfydZmysql]# chown -R mysql:mysql .
2015-07-0409:50:32 22376 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-07-0409:50:32 22376 [Note] InnoDB: The InnoDB memory heap is disabled
2015-07-0409:50:32 22376 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-07-0409:50:32 22376 [Note] InnoDB: Memory barrier is not used
2015-07-0409:50:32 22376 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-07-0409:50:32 22376 [Note] InnoDB: Using CPU crc32 instructions
2015-07-0409:50:32 22376 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-07-0409:50:32 22376 [Note] InnoDB: Completed initialization of buffer pool
2015-07-0409:50:32 22376 [Note] InnoDB: Highest supported file format is Barracuda.
2015-07-0409:50:32 22376 [Note] InnoDB: 128 rollback segment(s) are active.
2015-07-0409:50:32 22376 [Note] InnoDB: Waiting for purge to start
2015-07-0409:50:32 22376 [Note] InnoDB: 5.6.25 started; log sequence number 1626047
2015-07-0409:50:32 22376 [Note] Binlog end
2015-07-0409:50:32 22376 [Note] InnoDB: FTS optimize thread exiting.
2015-07-0409:50:32 22376 [Note] InnoDB: Starting shutdown...
2015-07-0409:50:33 22376 [Note] InnoDB: Shutdown completed; log sequence number 1626057
2015-07-0409:50:33 22400 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-07-0409:50:33 22400 [Note] InnoDB: The InnoDB memory heap is disabled
2015-07-0409:50:33 22400 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-07-0409:50:33 22400 [Note] InnoDB: Memory barrier is not used
2015-07-0409:50:33 22400 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-07-0409:50:33 22400 [Note] InnoDB: Using CPU crc32 instructions
2015-07-0409:50:33 22400 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-07-0409:50:33 22400 [Note] InnoDB: Completed initialization of buffer pool
2015-07-0409:50:33 22400 [Note] InnoDB: Highest supported file format is Barracuda.
2015-07-0409:50:33 22400 [Note] InnoDB: 128 rollback segment(s) are active.
2015-07-0409:50:33 22400 [Note] InnoDB: Waiting for purge to start
2015-07-0409:50:33 22400 [Note] InnoDB: 5.6.25 started; log sequence number 1626057
2015-07-0409:50:33 22400 [Note] Binlog end
2015-07-0409:50:33 22400 [Note] InnoDB: FTS optimize thread exiting.
2015-07-0409:50:33 22400 [Note] InnoDB: Starting shutdown...
2015-07-0409:50:35 22400 [Note] InnoDB: Shutdown completed; log sequence number 1626067
To start mysqldat boot time you have to copy
support-files/mysql.serverto the right place for your system
PLEASE REMEMBERTO SET A PASSWORD FOR THE MySQL root USER !
To do so, startthe server, then issue the following commands:
/usr/local/Centling/mysql/bin/mysqladmin -uroot password 'new-password'
/usr/local/Centling/mysql/bin/mysqladmin -uroot -h iZ281hdlfydZ password 'new-password'
/usr/local/Centling/mysql/bin/mysql_secure_installation
which will alsogive you the option of removing the test
databases andanonymous user created by default. Thisis
stronglyrecommended for production servers.
See the manualfor more instructions.
You can start theMySQL daemon with:
cd . ;/usr/local/Centling/mysql/bin/mysqld_safe &
You can test theMySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report anyproblems at http://bugs.mysql.com/
The latestinformation about MySQL is available on the web at
Support MySQL bybuying support/licenses at http://shop.mysql.com
WARNING: Foundexisting config file /usr/local/Centling/mysql/my.cnf on the system.
Because this filemight be in use, it was not replaced,
but was used inbootstrap (unless you used --defaults-file)
and when youlater start the server.
The new defaultconfig file was created as /usr/local/Centling/mysql/my-new.cnf,
please compare itwith your file and take the changes you need.
[root@iZ281hdlfydZmysql]# mv my.cnf my.cnf.old
bin data include lib my.cnf.old mysql-test scripts sql-bench
COPYING docs INSTALL-BINARY man my-new.cnf README share support-files
2015-07-0409:54:59 22431 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-07-0409:54:59 22431 [Note] InnoDB: The InnoDB memory heap is disabled
2015-07-0409:54:59 22431 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-07-0409:54:59 22431 [Note] InnoDB: Memory barrier is not used
2015-07-0409:54:59 22431 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-07-0409:54:59 22431 [Note] InnoDB: Using CPU crc32 instructions
2015-07-0409:54:59 22431 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-07-0409:54:59 22431 [Note] InnoDB: Completed initialization of buffer pool
2015-07-0409:54:59 22431 [Note] InnoDB: Highest supported file format is Barracuda.
2015-07-0409:54:59 22431 [Note] InnoDB: 128 rollback segment(s) are active.
2015-07-0409:54:59 22431 [Note] InnoDB: Waiting for purge to start
2015-07-0409:54:59 22431 [Note] InnoDB: 5.6.25 started; log sequence number 1626067
2015-07-0409:54:59 22431 [Note] Binlog end
2015-07-0409:54:59 22431 [Note] InnoDB: FTS optimize thread exiting.
2015-07-0409:54:59 22431 [Note] InnoDB: Starting shutdown...
2015-07-0409:55:00 22431 [Note] InnoDB: Shutdown completed; log sequence number 1626077
2015-07-0409:55:00 22454 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-07-0409:55:00 22454 [Note] InnoDB: The InnoDB memory heap is disabled
2015-07-0409:55:00 22454 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-07-04 09:55:0022454 [Note] InnoDB: Memory barrier is not used
2015-07-0409:55:00 22454 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-07-0409:55:00 22454 [Note] InnoDB: Using CPU crc32 instructions
2015-07-0409:55:00 22454 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-07-0409:55:00 22454 [Note] InnoDB: Completed initialization of buffer pool
2015-07-0409:55:00 22454 [Note] InnoDB: Highest supported file format is Barracuda.
2015-07-0409:55:00 22454 [Note] InnoDB: 128 rollback segment(s) are active.
2015-07-0409:55:00 22454 [Note] InnoDB: Waiting for purge to start
2015-07-0409:55:00 22454 [Note] InnoDB: 5.6.25 started; log sequence number 1626077
2015-07-0409:55:00 22454 [Note] Binlog end
2015-07-0409:55:00 22454 [Note] InnoDB: FTS optimize thread exiting.
2015-07-0409:55:00 22454 [Note] InnoDB: Starting shutdown...
2015-07-0409:55:02 22454 [Note] InnoDB: Shutdown completed; log sequence number 1626087
To start mysqldat boot time you have to copy
support-files/mysql.serverto the right place for your system
PLEASE REMEMBERTO SET A PASSWORD FOR THE MySQL root USER !
To do so, startthe server, then issue the following commands:
/usr/local/Centling/mysql/bin/mysqladmin -uroot password 'new-password'
/usr/local/Centling/mysql/bin/mysqladmin -uroot -h iZ281hdlfydZ password 'new-password'
/usr/local/Centling/mysql/bin/mysql_secure_installation
which will alsogive you the option of removing the test
databases andanonymous user created by default. Thisis
stronglyrecommended for production servers.
See the manualfor more instructions.
You can start theMySQL daemon with:
cd . ;/usr/local/Centling/mysql/bin/mysqld_safe &
You can test theMySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report anyproblems at http://bugs.mysql.com/
The latestinformation about MySQL is available on the web at
Support MySQL bybuying support/licenses at http://shop.mysql.com
New defaultconfig file was created as /usr/local/Centling/mysql/my.cnf and
will be used bydefault by the server when you start it.
You may edit thisfile to change server settings
[root@iZ281hdlfydZmysql]#cp support-files/mysql.server /etc/init.d/mysqld
[root@iZ281hdlfydZmysql]# chmod 755 /etc/rc.d/init.d/mysqld
[root@iZ281hdlfydZmysql]# chkconfig --add mysqld
[root@iZ281hdlfydZmysql]# chkconfig mysqld on
[root@iZ281hdlfydZmysql]# service mysqld start
[root@iZ281hdlfydZmysql]# netstat -anpt |grep mysqld
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 22707/mysqld
[root@iZ281hdlfydZmysql]# mysql -uroot -h localhost -p
Welcome to theMySQL monitor. Commands end with ; or\g.
Server version:5.6.25 Source distribution
Copyright (c)2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is aregistered trademark of Oracle Corporation and/or its
affiliates. Othernames may be trademarks of their respective
Type 'help;' or'\h' for help. Type '\c' to clear the current input statement.
[root@iZ281hdlfydZmysql]# cp -r data/* /data/mysql
[root@iZ281hdlfydZmysql]# service mysqld stop
[root@iZ281hdlfydZmysql]# mysqld_safe --skip-grant-tables & mysql -uroot -p
Enter password:150704 10:42:13 mysqld_safe Logging to '/data/mysql/iZ281hdlfydZ.err'.
150704 10:42:13mysqld_safe Starting mysqld daemon with databases from /data/mysql
Welcome to theMySQL monitor. Commands end with ; or\g.
Server version:5.6.25 Source distribution
Copyright (c)2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is aregistered trademark of Oracle Corporation and/or its
affiliates. Othernames may be trademarks of their respective
Type 'help;' or'\h' for help. Type '\c' to clear the current input statement.
Reading tableinformation for completion of table and column names
You can turn offthis feature to get a quicker startup with -A
mysql> updateuser set password=PASSWORD('123')where user='root'
Query OK, 0 rowsaffected (0.00 sec)
Rows matched:3 Changed: 0 Warnings: 0
Query OK, 0 rowsaffected (0.00 sec)
[root@iZ281hdlfydZmysql]# service mysqld restart
[1]+ Done mysqld_safe --skip-grant-tables
[root@iZ281hdlfydZmysql]# mysql -uroot -p123
Warning: Using apassword on the command line interface can be insecure.
Welcome to theMySQL monitor. Commands end with ; or\g.
Server version: 5.6.25Source distribution
Copyright (c)2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is aregistered trademark of Oracle Corporation and/or its
affiliates. Othernames may be trademarks of their respective
Type 'help;' or'\h' for help. Type '\c' to clear the current input statement.
四、安装apache
[root@iZ281hdlfydZ src]#cd /usr/local/src
[root@iZ281hdlfydZ src]#tar zxvf httpd-2.4.12.tar.gz
[root@iZ281hdlfydZ src]# cd httpd-2.4.12
[root@iZ281hdlfydZ httpd-2.4.12]# ls
ABOUT_APACHE ap.d CHANGES docs INSTALL Makefile.in os server
acinclude.m4 build CMakeLists.txt emacs-style InstallBin.dsp Makefile.win README srclib
Apache-apr2.dsw BuildAll.dsp config.layout httpd.dsp LAYOUT modules README.cmake support
Apache.dsw BuildBin.dsp configure httpd.spec libhttpd.dsp NOTICE README.platforms test
apache_probes.d buildconf configure.in include LICENSE NWGNUmakefile ROADMAP VERSIONING
[root@iZ281hdlfydZ src]#tar zxvf apr-1.5.2.tar.gz
[root@iZ281hdlfydZ src]# cd apr-1.5.2
[root@iZ281hdlfydZ apr-1.5.2]# ./configure--prefix=/usr/local/apr
[root@iZ281hdlfydZ apr-1.5.2]# make&& make install
[root@iZ281hdlfydZ src]# tar zxvfapr-util-1.5.4.tar.gz
[root@iZ281hdlfydZ src]# cd apr-util-1.5.4
[root@iZ281hdlfydZapr-util-1.5.4]#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@iZ281hdlfydZ apr-util-1.5.4]# make&& make install
[root@iZ281hdlfydZ src]# cd httpd-2.4.12
[root@iZ281hdlfydZ httpd-2.4.12]# echo $?
[root@iZ281hdlfydZ httpd-2.4.12]# make&& make install
[root@iZ281hdlfydZ httpd-2.4.12]# echo $?
Apache编译安装成功后安装路径为:/usr/local/apache
[root@iZ281hdlfydZ httpd-2.4.12]# cp/usr/local/apache/bin/apachectl /etc/init.d/httpd
[root@iZ281hdlfydZ httpd-2.4.12]# chmod +x/etc/profile.d/httpd.sh
[root@iZ281hdlfydZ httpd-2.4.12]# source/etc/profile.d/httpd.sh
[root@iZ281hdlfydZ httpd-2.4.12]#
#编辑配置文件/etc/httpd/httpd.conf添加 ServerNamelocalhost
[root@iZ281hdlfydZ httpd-2.4.12]# servicehttpd start
[root@iZ281hdlfydZ httpd-2.4.12]# netstat-anpt |grep "80"
[root@iZ281hdlfydZ httpd-2.4.12]# chkconfig--add httpd
service httpd does not support chkconfig
[root@iZ281hdlfydZ httpd-2.4.12]# chkconfighttpd on
service httpd does not support chkconfig
如果想把apache服务加入到开机自启,可以修改服务启动脚本:
# description: This is apache server
85和15代表开机和关机的启动顺序,数值越大代表启动的优先级越低
[root@iZ281hdlfydZ httpd-2.4.12]# chkconfig --add httpd
[root@iZ281hdlfydZhttpd-2.4.12]# chkconfig httpd on
[root@iZ281hdlfydZhttpd-2.4.12]# echo $?
五、安装PHP
[root@iZ281hdlfydZ php-5.6.10]# yum installlibmcrypt libmcrypt-devel mcrypt mhash
[root@iZ281hdlfydZ src]# tar zxvfphp-5.6.10.tar.gz
[root@iZ281hdlfydZ src]# cd php-5.6.10
[root@iZ281hdlfydZ src]# tar zxvflibiconv-1.14.tar.gz
[root@iZ281hdlfydZ src]# cd libiconv-1.14
[root@iZ281hdlfydZ libiconv-1.14]#./configure --prefix=/usr/local
[root@iZ281hdlfydZ libiconv-1.14]# echo $?
[root@iZ281hdlfydZ libiconv-1.14]# make&& make install
[root@iZ281hdlfydZ libiconv-1.14]# echo $?
[root@iZ281hdlfydZphp-5.6.10]#./configure --prefix=/usr/local/Centling/php5--with-config-file-path=/usr/local/Centling/etc --enable-mbstring --enable-ftp--with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --enable-magic-quotes--with-mysql=/usr/local/Centling/mysql --with-pear --enable-sockets --with-ttf--with-freetype-dir=/usr --enable-gd-native-ttf --with-zlib --enable-sysvsem--enable-exif --enable-sysvshm --with-libxml-dir=/usr --with-apxs2=/usr/local/apache/bin/apxs--with-iconv=/usr/local/libiconv --with-iconv-dir=/usr/local --with-xmlrpc--enable-xml --enable-shmop --enable-zip --with-mhash --with-mcrypt--enable-discard-path --enable-bcmath --enable-inline-optimization --with-curl--with-curlwrappers --enable-mbregex --with-openssl --disable-fileinfo
[root@iZ281hdlfydZ php-5.6.10]# make && make install
[root@iZ281hdlfydZ php-5.6.10]# cp php.ini-production/usr/local/Centling/etc/php.ini
[root@iZ281hdlfydZ php-5.6.10]# echo'ulimit -SHn 65535' >> /etc/rc.local
[root@iZ281hdlfydZ php-5.6.10]# servicehttpd start
httpd (pid 21581) already running
PATH=/usr/local/Centling/php5/bin:$PATH
[root@iZ281hdlfydZ php-5.6.10]# vim/etc/profile
[root@iZ281hdlfydZ php-5.6.10]# source/etc/profile
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
DirectoryIndex index.html index.php
/usr/local/apache/htdocs/phpinfo.php
// Show just the module information. 陆枚?戮PHP模驴茅息拢卢
六、更改apache根目录为/data/www
现在apache的默认目录是/usr/local/apache/htdocs
[root@iZ281hdlfydZ data]#mkdir www
[root@iZ281hdlfydZ data]# chmod -R 755/data/www
找到DocumentRoot “/usr/local/apache/htdocs” 这一段 #apache的根目录
把/usr/local/apache/htdocs这个目录改为/data/www
再找到#定义apache /usr/local/apache/htdocs这个区域
把 /usr/local/apache/htdocs改成/data/www
[root@iZ281hdlfydZhtdocs]# vim /etc/httpd/httpd.conf
[root@iZ281hdlfydZhtdocs]# service httpd restart
七、搭建FTP服务器
[root@iZ281hdlfydZ www]# rpm -qa |grepvsftpd
[root@iZ281hdlfydZ www]# yum -y installvsftpd
[root@iZ281hdlfydZ www]# chkconfig vsftpdon
启动vsftpd: service vsftpd start
重启vsftpd: service vsftpd restart
[root@iZ281hdlfydZ www]# service vsftpdstart
Starting vsftpd for vsftpd: [ OK ]
[root@iZ281hdlfydZ www]# cp /etc/vsftpd/vsftpd.conf/etc/vsftpd/vsftpd.conf.bak
[root@iZ281hdlfydZ ~]# service iptablesstatus
iptables: Firewall is not running.
[root@iZ281hdlfydZ ~]# iptables -P OUTPUTACCEPT
[root@iZ281hdlfydZ ~]# service iptablessave
iptables: Saving firewall rules to/etc/sysconfig/iptables:[ OK ]
[root@iZ281hdlfydZ ~]# service iptablesstatus
#修改/etc/vsftpd/vsftpd.conf配置新用户
#把传输记录的日志保存到/var/log/vsftpd.log
[root@iZ281hdlfydZ ~]# touch /var/log/vsftpd.log
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=NO
# 允许ASCII模式上传
ascii_upload_enable=YES
# 允许ASCII模式下载
ascii_download_enable=YES
# 欢迎标语
ftpd_banner=Welcome to use Centling ftp server.
[root@iZ281hdlfydZ ~]# chmod -R 777/data/ftproot
#递归地把此目录及该目录下所有文件和子目录的组属性设置成ftp组
[root@iZ281hdlfydZ ~]# chgrp -R ftp/data/ftproot
#创建用户ftpuser指向目录/data/ftproot,禁止登录SSH权限
[root@iZ281hdlfydZ ~]# useradd -d/data/ftproot -g ftp -s /sbin/nologin ftpuser
useradd: warning: the home directory alreadyexists.
Not copying any file from skeldirectory into it.
[root@iZ281hdlfydZ ~]# passwd ftpuser
Changing password for user ftpuser.
BAD PASSWORD: it is WAY too short
passwd: all authentication tokens updatedsuccessfully.
[root@iZ281hdlfydZ www]# service vsftpd restart
八、安装phpMyAdmin
1、官网http://www.phpmyadmin.net/ 下载phpMyAdmin-4.4.10-all-languages.tar.gz
阿里云CentOS6.5挂载数据盘以及搭建LAMP环境相关推荐
- 阿里云CentOS服务器挂载数据盘
本次使用的是centOS6.7 64位系统 第一步:处理阿里云磁盘挂载问题 查看磁盘情况,本次机器系统盘为阿里云赠送的20G,数据盘为100G 其中/dev/xvda为系统盘,/dev/xvdb为数据 ...
- 最新阿里云ECS服务器挂载数据盘亲测好用挂载成功分享一下
最近网站打不开了,发现服务器系统盘不够用了.查看磁盘占用情况,系统盘已经快满了,不能考虑到后期的需求,不能每次都去清理,不得不增加数据盘,这里记录下数据盘的挂载过程,也是找了好多参考方法亲测成功分享出 ...
- 腾讯云linux数据盘格式化,腾讯云服务器Centos挂载数据盘的方法
腾讯云服务器Centos挂载数据盘的方法 发布时间:2020-08-24 08:24:30 来源:脚本之家 阅读:138 作者:逐风 栏目:服务器 第一.检查硬盘设备是否有数据盘 # 先执行 fdis ...
- 什么是阿里云服务器系统盘和数据盘?
通俗的将,云服务器的系统盘类似于Windows系统的C盘,数据盘相当于其他的盘符,下面从系统盘和数据盘创建.使用及数据方面来说说二者的区别: 系统盘和数据盘的创建方式区别: 系统盘:随ECS云服务器一 ...
- 阿里云服务器ECS添加数据盘
此文章不详细介绍各工具的使用方法. 具体使用到的工具有parted,mkfs.ext4,e2label,LVM管理 一.普通硬盘方式挂载数据盘 1.使用parted -l查看,发现硬盘. 2.使用pa ...
- 如何挂载阿里云Linux服务器的“数据盘”(新购买)
购买的阿里云主机,官方只给你挂载了一个系统盘(20G),那如何挂载 新的"数据盘"呢? 操作过程如下: 第一.检查阿里云服务器数据盘情况 利用 fdisk -l 命令,检查当前的数 ...
- 天翼云桌面Linux,天翼云Linux主机如何挂载数据盘
天翼云Linux主机如何挂载数据盘 天翼云Linux主机如何挂载数据盘?很多使用了天翼云主机的朋友不是很清楚,对此了解比较片面,不清楚具体的步骤有哪些?一团网小编就来为大家详细分解一下天翼云Linux ...
- 【linux】云服务器挂载数据盘
前言:本篇教程是以腾讯云轻量云服务器进行测试发布教程,Linux的云服务器数据盘未做分区和格式化,可以根据以下步骤进行分区以及格式化操作,这里我使用的Linux的SSH登陆软件是Xshell7. 1. ...
- 修改服务器挂载设置,UCloud云服务器新增加数据盘且扩容存储量并且修改挂载目录...
相关商家推荐 UCloud优刻得 - 提供31+数据中心 新人云服务器优惠 介绍:UCloud是一家国内的云服务器提供商,提供31+数据中心,包括香港CN2数据中心,科创板上市,新人的优惠福利比较大. ...
最新文章
- pytorch中tensor的unsqueeze()函数和squeeze()函数的用处
- 归并排序的 Go 语言实现和优化
- 从阿里云下载图片到本地
- 有感而发 - 日新月异的SAP开发技术
- Windows 10 内测版:你有Edge了,不需要别的浏览器!
- 数据结构--汉诺塔--借助栈实现非递归---Java
- python随机生成验证码_Python生成随机验证码的两种方法
- 西安理工大学计算机视觉与应用,赵明华 - 西安理工大学 - 计算机科学与工程学院...
- 点晴oa系统搭服务器,免费OA办公系统的亮点所在
- 项目配置urule规则引擎教程详解(带视频资源)
- codesys 实现冒泡排序
- 个人中心网页设计html,超全面!个人中心页面从思考到设计全过程
- IDEA补丁破解使用方法
- 计算机打印机密码怎么设置,电脑设置了密码打印机打不了怎么办
- 农业灌溉水力驱动过滤器
- 区块链Fabric 技术架构和交易流程
- ctf MISC 简单套娃
- 博通wifi 芯片配置工具wl 详解
- mysql子查询:查出本网站goods_id最大的一条商品和每个栏目下id号最大的一条商品.
- cfa三级真题和mock_cfa mock和真题哪个难(cfa mock和真题差别)
热门文章
- 【Delphi入门】网络服务2(POP3协议 NMPOP3组件)
- 不知道有哪些滚动提词器软件?这2个好用提词器推荐给你
- vue 城市选择器(省市区)的使用 element-china-area-data
- 27套商务模板PPT [炫酷动态]
- Android黑莓解锁,还有绝招?黑莓Passport银色版跑上安卓系统
- 【SQL事务】事务是如何实现的?
- linux安装atm无法定位软件包,Ubuntu 安装snmp报Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }错误...
- 小米降级刷机遇到update crc list failed等flash问题处理
- 释放License命令
- Python:(使用matplotlib画图)图中嵌套子图