服务器部署全程记录(centos6.5)
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
创建文件夹:mkdir /usr/local/oracle_file
上传安装包到上面目录:
put E:\yz_index\installPackage\p13390677_112040_Linux-x86-64_1of7.zip
put E:\yz_index\installPackage\p13390677_112040_Linux-x86-64_2of7.zip
解压文件:
unzip p13390677_112040_Linux-x86-64_1of7.zip
unzip p13390677_112040_Linux-x86-64_2of7.zip
赋予权限:
chown -R oracle:oinstall database
chmod -R 755 database
切换Oracle:su oracle
安装:
运行命令:./runInstaller -silent -responseFile /usr/local/oracle_file/database/response/db_install.rsp -ignorePrereq
接下来就是等待(有点长,不要着急!!!)开始计时,快的话10分钟左右。(安装好的图示在下页)
安装过程中,如果提示[WARNING]不必理会,此时安装程序仍在后台进行,如果出现[FATAL],则安装程序已经停止了。
可以在以下位置找到本次安装会话的日志:
/tmp/OraInstall2018-12-16_03-29-49PM/installActions2018-12-16_03-29-49PM.log
可以使用命令查看日志:后面的地址应该以安装过程中的提示为准
#tail -100f /tmp/OraInstall2018-12-16_03-29-49PM/installActions2018-12-16_03-29-49PM.log
安装成功结果:
[oracle@localhost oracle]$ /usr/local/oracle_file/database/./runInstaller -silent -force -ignorePrereq -responseFile /usr/local/oracle/db_install.rsp Starting Oracle Universal Installer... Checking Temp space: must be greater than 120 MB. Actual 264977 MB Passed Checking swap space: must be greater than 150 MB. Actual 10239 MB Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-12-16_04-53-13PM. Please wait ...[oracle@localhost oracle]$ You can find the log of this install session at: /usr/local/oraInventory/logs/installActions2018-12-16_04-53-13PM.log The installation of Oracle Database 11g was successful. Please check '/usr/local/oraInventory/logs/silentInstall2018-12-16_04-53-13PM.log' for more details. As a root user, execute the following script(s): 1. /usr/local/oraInventory/orainstRoot.sh 2. /usr/local/oracle/product/11.2.0/db_1/root.sh
错误1:
报错信息:./runInstaller: line 97: /root/database/install/.oui: Permission denied
解决方法:需切换到root用户授权,如果runInstaller变为绿色还是报这个错,则需要把文件夹移到非root目录下,在进行安装
错误2:
报错信息:
If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.
Typical path for xclock: /usr/X11R6/bin/xclock
解决方法:换这个命令安装./runInstaller -silent -responseFile /usr/local/oracle_file/database/response/db_install.rsp -ignorePrereq
错误3:
INFO: Finding the most appropriate exit status for the current application INFO: Exit Status is -2 INFO: Shutdown Oracle Database 11g Release 2 Installer
解决方法:vi response/db_install.rsp修改DECLINE_SECURITY_UPDATES=TRUE
参考
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