宝塔面板及Apache等运行环境均不能启动

宝塔面板不能启动,提示服务不存在,6.x版本使用以下命令可修复:

curl http://download.bt.cn/install/update6.sh|bash

5.x版本使用以下命令修复:

curl http://download.bt.cn/install/update.sh|bash

命令执行完成即可正常登录面板,但发现Apache、MySQL、PHP等运行环境都无法启动,使用以下命令启动Apache:

service httpd start

报错:

httpd: unrecognized service

使用以下命令启动Apache:

/etc/init.d/httpd start

报错:

-bash: /etc/init.d/httpd: No such file or directory

更新Apache失败,卸载Apache重装仍然失败,错误如下:

checking whether we are cross compiling... configure: error: in `/www/server/apache/src/srclib/apr':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
configure failed for srclib/apr
make: *** No targets specified and no makefile found. Stop.
apache.sh: line 189: /etc/init.d/httpd: No such file or directory
make: *** No rule to make target `install'. Stop.
done

执行以下命令安装Apache的依赖包,然后再安装Apache成功:

yum -y install gcc gcc-c++ libtool-libs autoconf \
freetype-devel gd libjpeg-devel libpng-devel libxml2-devel \
ncurses-devel zlib-devel zip unzip curl-devel wget crontabs \
file bison cmake patch mlocate flex diffutils automake make \
kernel-devel cpp readline-devel openssl-devel vim-minimal \
glibc-devel glib2-devel bzip2-devel e2fsprogs-devel \
libidn-devel gettext-devel expat-devel libcap-devel \
libtool-ltdl-devel pam-devel pcre-devel libmcrypt-devel

PHP和FTP无法启动均可卸载重装,MySQL担心丢失数据,所以采取以下方法。

查找mysql.server文件,得到该文件的完整路径:

find / -name mysql.server

拷贝mysql.server到/etc/init.d/mysqld目录中:

cp /www/server/mysql/support-files/mysql.server /etc/init.d/mysqld

启动MySQL:

/etc/init.d/mysqld start
分享:

发表评论