当前位置:网站首页>项目一:部署 LAMP ecshop电商平台
项目一:部署 LAMP ecshop电商平台
2022-06-30 00:00:00 【XUPT-BDAL-LAB-ML&OP】
网络
vim /etc/sysconfig/network-scripts/ifcfg-ens32
ip mask dns gateway
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenfore 0
systemctl disabled firewalld
systemctl stop firewalld
iptables -F
yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
vim /etc/yum.repos.d/CentOS-Media.repo
mount /dev/sr0 /media
echo "/dev/sr0 /media iso9660 defaults 0 0" >> /etc/fstab
mount -a
安装依赖
yum install -y gcc*
链接:https://pan.baidu.com/s/1xnLWr1GGugu79oL2vyj_tA?pwd=6j5z
提取码:6j5z
--来自百度网盘超级会员V3的分享
[[email protected] software]# ll
total 70364
-rw-r--r--. 1 root root 72049715 Jun 27 07:18 LAMP.zip
unzip LAMP.zip
mv /root/LAMP/ /lamp
[[email protected] lamp]# ll
total 71524
-rw-r--r--. 1 root root 982243 Feb 24 2020 apr-1.4.6.tar.gz
-rw-r--r--. 1 root root 774770 Feb 24 2020 apr-util-1.4.1.tar.gz
-rw-r--r--. 1 root root 1775673 Feb 24 2020 freetype-2.3.5.tar.gz
-rw-r--r--. 1 root root 6747087 Feb 24 2020 httpd-2.4.7.tar.gz
-rw-r--r--. 1 root root 613261 Feb 24 2020 jpegsrc.v6b.tar.gz
-rw-r--r--. 1 root root 1335178 Feb 24 2020 libmcrypt-2.5.8.tar.gz
-rw-r--r--. 1 root root 792139 Feb 24 2020 libpng-1.2.31.tar.gz
-rw-r--r--. 1 root root 5172503 Feb 24 2020 libxml2-2.9.1.tar.gz
-rw-r--r--. 1 root root 471915 Nov 22 2008 mcrypt-2.6.8.tar.gz
-rw-r--r--. 1 root root 326970 Feb 25 2020 memcached-1.4.17.tar.gz
-rw-r--r--. 1 root root 931437 Dec 8 2008 mhash-0.9.9.9.tar.gz
-rw-r--r--. 1 root root 21201193 Feb 24 2020 mysql-5.5.48.tar.gz
-rw-r--r--. 1 root root 2826473 Feb 24 2020 ncurses-5.9.tar.gz
-rw-r--r--. 1 root root 1933734 Feb 24 2020 pcre-8.34.tar.gz
-rw-r--r--. 1 root root 401230 Feb 25 2020 pecl-memcache-php7.zip
-rw-r--r--. 1 root root 18218591 Feb 24 2020 php-7.0.7.tar.gz
-rw-r--r--. 1 root root 8198197 Feb 24 2020 phpMyAdmin-4.1.4-all-languages.tar.gz
-rw-r--r--. 1 root root 242 Feb 24 2020 tar.sh
-rw-r--r--. 1 root root 496597 Feb 24 2020 zlib-1.2.3.tar.gz
sh tar.sh
# 开始安装依赖
yum install -y libxml2-devel python-devel
cd /lamp/libxml2-2.9.1
./configure --prefix=/usr/local/libxml2/ && make -j 4 && make install && echo $?
cd /lamp/libmcrypt-2.5.8
./configure --prefix=/usr/local/libmcrypt/ && make -j 4 && make install && echo $?
cd /lamp/libmcrypt-2.5.8/libltdl
./configure --enable-ltdl-install && make -j 4 && make install && echo $?
cd /lamp/mhash-0.9.9.9
./configure && make -j 4 && make install && echo $?
cd /lamp/mcrypt-2.6.8
export LD_LIBRARY_PATH=/usr/local/libmcrypt/lib:/usr/local/lib
# 变量:LD_LIBRARY_PATH用于指定libmcrypt和mhash的库的位置
./configure --with-libmcrypt-prefix=/usr/local/libmcrypt && make -j 4 && make install && echo $?
cd /lamp/zlib-1.2.3
./configure
# 然后修改配置文件,否则无法正常安装此软件
vim Makefile
CFLAGS=-O3 -DUSE_MMAP -fPIC
# 找到CFLAGS=-O3 -DUSE_MMAP,在后面加入-fPIC 变成(注意:小f大PIC,空格)
make -j 4 && make install && echo $?
cd /lamp/libpng-1.2.31
./configure --prefix=/usr/local/libpng && make -j 4 && make install && echo $?
mkdir /usr/local/jpeg6
mkdir /usr/local/jpeg6/bin
mkdir /usr/local/jpeg6/lib
mkdir /usr/local/jpeg6/include
mkdir -p /usr/local/jpeg6/man/man1
yum -y install libtool*
cd /lamp/jpeg-6b
cp -a /usr/share/libtool/config/config.sub ./
cp -a /usr/share/libtool/config/config.guess ./
# 复制libtool中的文件,覆盖jpeg-6b中的文件(64位中的问题)
./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static && make -j 4 && make install && echo $?
cd /lamp/freetype-2.3.5
./configure --prefix=/usr/local/freetype/ && make -j 4 && make install && echo $?
apache
cp -a /lamp/apr-1.4.6/lamp/httpd-2.4.7/srclib/apr
cp -a /lamp/apr-util-1.4.1/lamp/httpd-2.4.7/srclib/apr-util
cd /lamp/pcre-8.34
./configure && make -j 4 && make install && echo $?
yum -y install openssl-devel
cd /lamp/httpd-2.4.7
./configure \
--prefix=/usr/local/apache2 \
--sysconfdir=/usr/local/apache2/etc \
--with-included-apr \
--enable-so \
--enable-deflate=shared \
--enable-expires=shared \
--enable-rewrite=shared --enable-ssl
make -j 4 && make install && echo $?
/usr/local/apache2/bin/apachectl start
ps aux | grep httpd
netstat -tlun | grep :80
yum -y install ncurses-devel
cd /lamp/ncurses-5.9
./configure --with-shared \
--without-debug --without-ada \
--enable-overwrite && make -j 4 && make install && echo $?
yum -y install cmake bison
mysql
useradd -r -s /sbin/nologin mysql
cd /lamp/mysql-5.5.48
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 \
-DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 && make && make install && echo $?
cd /usr/local/mysql/
chown -R root .
chown -R mysql data
cp -a /lamp/mysql-5.5.48/support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
./scripts/mysql_install_db --user=mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
/usr/local/mysql/bin/mysqladmin -uroot password 123456
/usr/local/mysql/bin/mysql -u root -p
PHP
cd /lamp/php-7.0.7
./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ \
--with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/libxml2/ \
--with-jpeg-dir=/usr/local/jpeg6/ --with-png-dir=/usr/local/libpng/ \
--with-freetype-dir=/usr/local/freetype/ --with-mcrypt=/usr/local/libmcrypt/ \
--with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all \
--enable-sockets --with-pdo-mysql=/usr/local/mysql --with-gd --without-pear && make && make install && echo $?
mkdir /usr/local/php/etc
cp /lamp/php-7.0.7/php.ini-production /usr/local/php/etc/php.ini
vim /usr/local/apache2/etc/httpd.conf
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
/usr/local/apache2/bin/apachectl stop
/usr/local/apache2/bin/apachectl start
vim /usr/local/apache2/htdocs/test.php
<?php
phpinfo();
?>
http://192.168.222.101/test.php
cd /lamp/php-7.0.7/ext/openssl
mv config0.m4 config.m4
/usr/local/php/bin/phpize
./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config && make && make install && echo $?
vi /usr/local/php/etc/php.ini
# 加最后即可
extension_dir="/usr/local/php/lib/php/extensions/no-debug-zts-20151012/"
extension="openssl.so";
extension="memcache.so";
添加以上两个库文件的调用
重启 apache,刷新 phpinfo 页面,并查看是否有两个新增的模块
cd /lamp
# 坏了 wget ftp://ftp.pbone.net/mirror/ftp.centos.org/7.6.1810/os/x86_64/Packages/libevent-devel-2.0.21-4.el7.x86_64.rpm
yum -y install libevent-devel
cd /lamp/memcached-1.4.17
./configure --prefix=/usr/local/memcache && make && make install && echo $?
useradd -r -s /sbin/nologin memcache
添加 memcache用户,此用户不用登录,不设置密码
/usr/local/memcache/bin/memcached -umemcache &
启动 memcache服务,并设置为后台运行
netstat -an | grep :11211
检查 memcache是否正常启动,并监听了 11211端口
phpmyadmin
cp -a /lamp/phpMyAdmin-4.1.4-all-languages /usr/local/apache2/htdocs/phpmyadmin
cd /usr/local/apache2/htdocs/phpmyadmin
cp -a config.sample.inc.php config.inc.php
vim config.inc.php
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'http';
设置 auth_type为 http ,即设置为 HTTP身份认证模式(新增即可)
通过浏览器输入地址访问:http://Apache服务器地址/phpmyadmin/index.php
# vi /etc/rc.local
/usr/local/apache2/bin/apachectl start
/usr/local/mysql/bin/mysqld_safe --user=mysql &
/usr/local/memcache/bin/memcached -umemcache &

HEXO
边栏推荐
- 云服务器的安全设置常识
- Gradle serialization 7- configuration signature
- 多数元素II[求众数类之摩尔投票法]
- 旋转彩色三叶草
- Zhongkang holdings opens the offering: it plans to raise HK $395million net, and it is expected to be listed on July 12
- AI empowers new retail, the way to win "wisdom" lies in ecological thinking | selected excerpts from digital intelligence night talk live broadcast
- Xutils3 transfer set
- 手机开户一般哪个证券公司好?另外,手机开户安全么?
- vlog常用参数解析
- Matlab exercises -- program control process exercise
猜你喜欢

Create an API rapid development platform, awesome!
![多数元素II[求众数类之摩尔投票法]](/img/8f/5925f97c0f5f8c50c19a9ef6d7723c.png)
多数元素II[求众数类之摩尔投票法]

How to write controller layer code gracefully?

What is IGMP? What is the difference between IGMP and ICMP?

Golang6 reflection

New CorelDRAW technical suite2022 latest detailed function introduction

How to view the CPU cores and threads in win11? Win11 view the tutorial of how many cores and threads the CPU is

6.28日刷题题解

QT learning 06 widgets and window types

这次的PMP考试(6月25日),有人欢喜有人忧,原因就在这...
随机推荐
Exploration and Practice on the future direction of byte cloud database
打造一个 API 快速开发平台,牛逼!
雲和恩墨蓋國强,識別它、抓住它,在國產數據庫沸騰以前
@Scheduled注解的坑,我替你踩了
招商证券靠谱吗?开股票账户安全吗?
Andorid source build/envsetup.sh 该知道的细节
New CorelDRAW technical suite2022 latest detailed function introduction
ThinkPad VMware installation virtual machine: this host supports Intel VT-x, but Intel VT-x is disabled (problem resolution)
漫画安全HIDS、EDR、NDR、XDR
Sword finger offer 14- ii Cutting rope II
QT learning 06 widgets and window types
Analysis of common vlog parameters
云服务器的安全设置常识
matlab习题 —— 程序控制流程练习
西门子低代码平台通过Database Connector 连接Mysql 实现增删改查
Viewing splitchunks code segmentation from MPX resource construction optimization
Solr基础操作13
QT learning 02 GUI program example analysis
vlog常用参数解析
复制带随机指针的链表[空间换时间--hash记录]