当前位置:首页 » 网页前端 » centosontheweb
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

centosontheweb

发布时间: 2023-03-31 11:32:38

A. linux centOS下怎么配置web服务器

PS:系统概述
硬盘:130G
分区:两个分别是根目录(49G,系统及初始化软件)和/data(89G,空着的、我计划放所有网站)
已安装的程序:
1.vsftp
2.mysql
3.apache

在开始操作之前我们把密码改一下。。。还有就是本文中出现的《》这个符号都表示不用输入
passwdroot《设置root密码》
示例我们把所有网站程序都划分到/data/web/下,方便以后管理

老板要求
把在本地开发的php+mysql程序通过FTP架设到web服务器,并能通过域名正常访问网站。步骤/方法
第一步:创建FTP
================================================================
chmodgo+rwx/data《给data分配权限》
cd/data《进入data分区》
mkdirweb《建立web目录》
chmodgo+rwx/data/web
cd/《回到根目录,个人操作习惯,可跳过这步》

useradd-s/sbin/nologin-gftp–d/var/www/web/wyh.comjiangge
(注:-s/sbin/nologin是让其不能登陆系统,-d是指定用户目录为/var/www/web/wyh.com
jiangge为ftp用户名字)
passwdjiangge《设置FTP密码》
vi/etc/vsftpd/vsftpd.conf《修改FTP配置文件》
注:按一下i进入到编辑模式,修改完后按一下ESC退出编辑模式,再输入《:wq》(其作用是保存改修改并退出)《:q!》退出不保存《:q》没有做过修改用这个退出
idle_session_timeout
data_connection_timeout
找到这两个,,修改其值大于900,如果不修改这个的话,,FTP链接很慢
#xferlog_file
找到这个,删除#。。。作用是记录FTP的日志
/etc/init.d/vsftpdrestart《重启FTP后配置文件才会生效》
到此第一步OK你可用FTP登陆啦!
注:我这配置有这个问题没解决,登陆报超时,但你耐心的等一会,就会链接好,如果有盆友知道解决方法的,请帮解答一下。。。谢谢。。

======================================================================
第三步:配置mysql
==============================================================================
/usr/local/mysql/bin/mysql–uroot-p《登陆mysql,按一下ENTER然后输入mysql密码,默认和万网root密码一样》
usemysql;《选择mysql表》
grantalloncqwebseo_db.*tocqwebseo@localhostidentifiedby'cqwebseomysql';《添加一个数据,有所有权限,cqwebseo_db为数据库名,cqwebseo为用户名,cqwebseomysql为密码》
flushprivileges;《不用解释吧,真就度娘一下。》
exit;《这个也不用说吧》
/usr/local/mysql/bin/mysqladmin-uroot-p8y6v8a3c7ushutdown《停止mysql》
/usr/local/mysql/bin/mysqld_safe《启动mysql》
到此。。就Ok。注意。。注意。。。。。分号分号分号不要忘记了。
/usr/local/mysql/var《数据库存放目录》
================================================================================
第二步:配置httpd.conf
=======================================================================
echohi!Thistest!/data/web/cqwebseo.com>index.php《在cwebseo.com里面建立一个内容为hi!Thistest!的index.php文件》
vi/var/www/conf/httpd.conf《进入主战场》
按上下键,翻到文档最后,然后加入下列表代码(不知道怎么加进的,看第一步的注意事项)
<VirtualHost*:80>
DocumentRoot/data/web/cqwebseo
DirectoryIndexindex.php
[email protected]
ServerNamecqwebseo.com
ServerAliaswww.cqwebseo.com
#ErrorLog/data/web/sanmao/log/error.log
#TransferLog/data/web/sanmao/log/access.log
</VirtualHost>
简单说一下。。。。。。网上有很多这方面的资料
DocumentRoot/data/web/cqwebseo这个就是网站的决对地址说白就是你分配给他的FTP地址
DirectoryIndexindex.php这个表示网站默认首页是index.php
[email protected]服务管理员的邮箱
ServerNamecqwebseo.com这个你懂的
ServerAliaswww.cqwebseo.com这个也不需要解释吧
余下的两个被我注释掉喽,,,意思是网站的日志文件存放地
var/www/bin/apachectlrestart重启apachectl
var/www/bin/apachectlstop停止apachectl
var/www/bin/apachectlstart启动apachectl
OK到这里。。第二步就完。。。你能输入网址。。。看到这个目录啦。。不过有个前题条件。。这个个域名要解析过来了滴哈。。不然的话。。你就不要输入域名那两个。。直接用你服务的IP地址访问也行的。。。。如果你操作正确啦。。就能看到网页上出现hi!Tistest!

B. centos7怎么搭建web服务器

使用护卫神·主机大师,一键配置centos下的web服务器
一键安装apache/nginx+php+mysql+phpmyadmin+ftp

C. at the website和on the website 的区别

at the website和on the website 的区别在于前面的动词,和不同的介词构成不同的词组。

D. centos中怎么删除mysql数据库

查看已经安装的服务
rpm –qa|grep -i mysql
-i 作用是不区分大小写
yum remove mysql mysql-server mysql-libs compat-mysql51
rm -rf /var/lib/mysql
rm /etc/my.cnf
查看是否还有mysql软件:
rpm -qa|grep mysql
有的话继续删除
可以看到有两个安装包
MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-client-5.6.19-1.linux_glibc2.5.x86_64.rpm

删除这两个服务(去掉后缀)
rpm –e MySQL-client-5.6.19-1.linux_glibc2.5.x86_64
rpm -e MySQL-server-5.6.19-1.linux_glibc2.5.x86_64
查看残留的目录:
whereis mysql

然后删除mysql目录:
rm –rf /usr/lib64/mysql

删除相关文件:
rm –rf /usr/my.cnf
rm -rf /root/.mysql_sercret
最关键的:
rm -rf /var/lib/mysql
如果这个目录如果不删除,再重新安装之后,密码还是之前的密码,不会重新初始化!
网上查了很久都没有文章提到这个,最后还是自己摸索找出来的。

卸载完成!怎么确定是不是真的卸载干净了呢?
一是看安装输出:
如果没有卸载干净,安装server时输入只有两行:
[root @localhost opt]# rpm -ivh MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
卸载干净了安装输入如下:
[root @localhost opt]# rpm -ivh MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
2014-09-23 07:22:43 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-09-23 07:22:43 26041 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-09-23 07:22:43 26041 [Note] InnoDB: The InnoDB memory heap is disabled
2014-09-23 07:22:43 26041 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-09-23 07:22:43 26041 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-09-23 07:22:43 26041 [Note] InnoDB: Using Linux native AIO
2014-09-23 07:22:43 26041 [Note] InnoDB: Using CPU crc32 instructions
2014-09-23 07:22:43 26041 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-09-23 07:22:43 26041 [Note] InnoDB: Completed initialization of buffer pool
2014-09-23 07:22:43 26041 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2014-09-23 07:22:43 26041 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2014-09-23 07:22:43 26041 [Note] InnoDB: Database physically writes the file full: wait...
2014-09-23 07:22:43 26041 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2014-09-23 07:22:43 26041 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2014-09-23 07:22:45 26041 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2014-09-23 07:22:45 26041 [Warning] InnoDB: New log files created, LSN=45781
2014-09-23 07:22:45 26041 [Note] InnoDB: Doublewrite buffer not found: creating new
2014-09-23 07:22:45 26041 [Note] InnoDB: Doublewrite buffer created
2014-09-23 07:22:45 26041 [Note] InnoDB: 128 rollback segment(s) are active.
2014-09-23 07:22:45 26041 [Warning] InnoDB: Creating foreign key constraint system tables.
2014-09-23 07:22:45 26041 [Note] InnoDB: Foreign key constraint system tables created
2014-09-23 07:22:45 26041 [Note] InnoDB: Creating tablespace and datafile system tables.
2014-09-23 07:22:45 26041 [Note] InnoDB: Tablespace and datafile system tables created.
2014-09-23 07:22:45 26041 [Note] InnoDB: Waiting for purge to start
2014-09-23 07:22:45 26041 [Note] InnoDB: 5.6.19 started; log sequence number 0
A random root password has been set. You will find it in '/root/.mysql_secret'.
2014-09-23 07:22:46 26041 [Note] Binlog end
2014-09-23 07:22:46 26041 [Note] InnoDB: FTS optimize thread exiting.
2014-09-23 07:22:46 26041 [Note] InnoDB: Starting shutdown...
2014-09-23 07:22:48 26041 [Note] InnoDB: Shutdown completed; log sequence number 1625977
2014-09-23 07:22:48 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-09-23 07:22:48 26065 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-09-23 07:22:48 26065 [Note] InnoDB: The InnoDB memory heap is disabled
2014-09-23 07:22:48 26065 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-09-23 07:22:48 26065 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-09-23 07:22:48 26065 [Note] InnoDB: Using Linux native AIO
2014-09-23 07:22:48 26065 [Note] InnoDB: Using CPU crc32 instructions
2014-09-23 07:22:48 26065 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-09-23 07:22:48 26065 [Note] InnoDB: Completed initialization of buffer pool
2014-09-23 07:22:48 26065 [Note] InnoDB: Highest supported file format is Barracuda.
2014-09-23 07:22:48 26065 [Note] InnoDB: 128 rollback segment(s) are active.
2014-09-23 07:22:48 26065 [Note] InnoDB: Waiting for purge to start
2014-09-23 07:22:48 26065 [Note] InnoDB: 5.6.19 started; log sequence number 1625977
2014-09-23 07:22:48 26065 [Note] Binlog end
2014-09-23 07:22:48 26065 [Note] InnoDB: FTS optimize thread exiting.
2014-09-23 07:22:48 26065 [Note] InnoDB: Starting shutdown...
2014-09-23 07:22:50 26065 [Note] InnoDB: Shutdown completed; log sequence number 1625987
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.
You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.
Also, the account for the anonymous user has been removed.
In addition, you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test database.
This is strongly recommended for proction servers.
See the manual for more instructions.
Please report any problems at http://bugs.mysql.com/
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
最后一段中提示了重要信息,很多人因为不喜欢读英文,导致接下来不知道怎么操作!
二就是安装完成,启动服务之后

使用命令:“mysql -uroot -p”输入你之前安装后设置的密码,看能不能登录,如果还可以登录,说明没有卸载干净!

E. on the website 和 at the website 区别

为您解答
这个主要和前面动词的用法有关

The information is displayed on the website.
Let's see what's new on the website.
On强调在。。。上面,比较实质

Come and visit us at our website
At这里是通过。。。方式的用法
If you would like to take a look at the website ,click here.
这里用at是因为look