1.安装nginx
上传安装包:put E:\yz_index\installPackage\nginx-1.14.0.tar.gz
解压:tar zxvf nginx-1.14.0.tar.gz
切换:cd nginx-1.14.0
准备编译:./configure
编译:make
安装:make install
报错如下:
[root@localhost nginx-1.14.0]# make make: *** No rule to make target `build', needed by `default'. Stop. [root@localhost nginx-1.14.0]# make install make: *** No rule to make target `install'. Stop.
参考:https://www.cnblogs.com/zrbfree/p/6419043.html,是因为少环境
1.1.1 安装gcc
查看:rpm -qa gcc
安装: yum install gcc
1.1.2 安装PCRE库
查看: rpm -qa pcre
安装:yum install pcre pcre-devel
1.1.3 安装zlib
查看: rpm -qa zlib
安装:yum install zlib zlib-devel
1.1.4 安装OpenSSL
查看: rpm -qa openssl
安装:yum install openssl openssl-devel
我电脑少这个,所以执行这个安装命令
报错如下:
Error Downloading Packages: openssl-1.0.1e-57.el6.x86_64: failure: Packages/openssl-1.0.1e-57.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try. openssl-devel-1.0.1e-57.el6.x86_64: failure: Packages/openssl-devel-1.0.1e-57.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
参考:https://blog.csdn.net/wang_zhenwei/article/details/50536180
1.1.4.1 执行:yum clean all
1.1.4.2 执行:yum makecache,报错如下
[root@localhost nginx-1.14.0]# yum makecache Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was 14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'" Error: Cannot find a valid baseurl for repo: base
参考:https://www.cnblogs.com/phpandmysql/p/7773063.html
1.1.4.3 vi /etc/sysconfig/network-scripts/ifcfg-eth0, 末尾加入
DNS1=8.8.8.8 #常用 DNS2=4.2.2.2
DNS1=223.5.5.5 #阿里
DNS2=223.6.6.6
1.1.4.4 重启网络:ifup eth0
结果:这几台服务器连接不了外网,可能不是上面的原因,待续
后续:虚拟机开通了外网
1.1.4.5 测试: ping www.baidu.com ok
1.1.4.6 再次执行:yum makecache,报错如下
file:///cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///cdrom/repodata/repomd.xml Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: c6-media. Please verify its path and try again
参考:https://www.cnblogs.com/zgaspnet/p/5258732.html
查看文件:cat /etc/yum.repos.d/CentOS-Media.repo
将 baseurl修改为:http://centos.ustc.edu.cn/centos/5/os/i386/
将enabled修改为:0
1.1.4.7 再次执行:yum makecache. 成功,再次执行上面未完成命令,成功!
测试启动
cd /usr/local/nginx/sbin/
./nginx
设置开机自启
vi /etc/init.d/nginx
贴入如下代码,注意nginx安装路径,如果不是/usr/local则要改为自己的路径
#!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig: - 85 15 # description: Nginx is an HTTP(S) server, HTTP(S) reverse \ # proxy and IMAP/POP3 proxy server # processname: nginx # config: /etc/nginx/nginx.conf # config: /etc/sysconfig/nginx # pidfile: /var/run/nginx.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "$NETWORKING" = "no" ] && exit 0 nginx="/usr/local/nginx/sbin/nginx" prog=$(basename $nginx) NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" [ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx lockfile=/var/lock/subsys/nginx start() { [ -x $nginx ] || exit 5 [ -f $NGINX_CONF_FILE ] || exit 6 echo -n $"Starting $prog: " daemon $nginx -c $NGINX_CONF_FILE retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval } stop() { echo -n $"Stopping $prog: " killproc $prog -QUIT retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval killall -9 nginx } restart() { configtest || return $? stop sleep 1 start } reload() { configtest || return $? echo -n $"Reloading $prog: " killproc $nginx -HUP RETVAL=$? echo } force_reload() { restart } configtest() { $nginx -t -c $NGINX_CONF_FILE } rh_status() { status $prog } rh_status_q() { rh_status >/dev/null 2>&1 } case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart|configtest) $1 ;; reload) rh_status_q || exit 7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}" exit 2 esac
给予权限:chmod 755 /etc/init.d/nginx
增加为系统服务:chkconfig --add nginx
测试:
[root@localhost ~]# service nginx stop /etc/init.d/nginx: line 1: nx: command not found Stopping nginx: [ OK ] [root@localhost ~]# service nginx start /etc/init.d/nginx: line 1: nx: command not found Starting nginx: [ OK ]
安装oracle
上传安装包:
put E:\yz_index\installPackage\p13390677_112040_Linux-x86-64_1of7.zip
put E:\yz_index\installPackage\p13390677_112040_Linux-x86-64_2of7.zip
参考
170217、nginx 安装时候报错:make: *** No rule to make target `build', needed by `default'. Stop.
CentOS学习12_ [Errno 256] No more mirrors to try 解决方法
centos7 cannot find a valid baseurl for repo
解决yum错误:Cannot retrieve repository metadata (repomd.xml) for repository