当前位置:首页 » 云服务器 » linux搭建http服务器

linux搭建http服务器

发布时间: 2022-01-16 03:53:04

❶ 如何在linux搭建完整的web服务器

可以参考如下Web服务器的建立过程。示例环境及web服务器软件:

Ubuntu 12.04
LAMP(Linux,Apache,Mysqlphp

1、安装Apache

(1)在安装HTTP Server之前需安装APR(Apache Portable Runtime)和APR-util安装APR
$ tar zxvf apr-1.4.6.tar.gz
$ cd apr-1.4.6/
$ ./configure
$ make
$ sudo make install

(2)安装APR-util

$ tar zxvf apr-util-1.4.1.tar.gz
$ cd apr-util-1.4.1
$ ./configure –with-apr=/usr/local/apr (whereis apr)
$ make
$ sudo make install

(3)安装httpd-2.4.2.tar.bz2默认安装位置/usr/local/apache2网页放在/usr/local/apache2/htdocs配置文件/usr/local/apache2/conf/httpd.conf

$ tar jxvf httpd-2.4.2.tar.bz2
$ cd httpd-2.4.2/
$ ./configure
$ make
$ sudo make install

(4)启动HTTP Server$ sudo /usr/local/apache2/bin/apachectl startAH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message

(5)查看http是否正常运行$ netstat -a | grep httptcp 0 0 *:http *:* LISTEN

(6)在浏览器输入127.0.0.1如果正常应该显示“It works!”

2、安装MySQL

(1)、下载安装mysql-5.5.25.tar.gz,默认安装位置/usr/local/mysql/

$ tar zxvf mysql-5.5.25.tar.gz
$ cd mysql-5.5.25/
$ sudo groupadd mysql
$ sudo useradd -r -g mysql mysql
$ cmake .
$ make
$ sudo make install
$ cd /usr/local/mysql/
$ sudo chown -R mysql .
$ sudo chgrp -R mysql .
$ sudo scripts/mysql_install_db –user=mysql
$ sudo chown -R root .
$ sudo chown -R mysql data/
$ sudo cp support-files/my-medium.cnf /etc/my.cnf
$ sudo cp support-files/mysql.server /etc/init.d/mysql.server

(2)、启动MySQL:
方法1:$ sudo service mysql.server start
方法2:$ sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &

3、安装PHP

(1)安装下载php-5.4.4.tar.gz

$ tar zxvf php-5.4.4.tar.gz
$ cd php-5.4.4
$ ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mysqli --enable-mbstring --with-mcrypt(可能需要安装libmcrypt-dev )
$ sudo make install
$ sudo cp php.ini-development /usr/local/lib/php.ini

(2)配置HTTP Server使之支持PHPapache配置文件/usr/local/apache2/conf/httpd.conf修改或添加如下配置

<;IfMole dir_mole>
DirectoryIndex index.php
<;/IfMole>
<;FilesMatch \.php$>
SetHandler application/x-httpd-php
<;/FilesMatch>

(3)重启HTTP Server
$ sudo /usr/local/apache2/bin/apachectl restart

❷ linux centos怎么搭建http文件服务器

centos如果是建立文件服务器一般使用ftp,安装vsftp服务即可。
如果使用http的文件服务器,可以使用apache的目录浏览功能。

❸ linux 怎么创建http服务器

海腾曾超为您解答
实际上就是apache

http://blog.163.com/hlz_2599/blog/static/142378474201182811611382/

❹ linux系统下怎么搭建网站服务器

具体方法如下:

1、使用putty或类似的SSH工具登录服务器(本地安装跳过);

❺ 怎么在linux搭建web服务器

1.开始说明
本教程中使用的IP地址是192.168.0.100,主机名称为Server1.example.com 这些设置可能会有所不同,你需要根据不同情况进行修改。

CentOS 6.2下安装MySQL
2.开始安装MySQL5
首先我们应该先用下面的命令安装MySQL:
yum install mysql mysql-server
然后我们需要创建MySQL系统的启动键链接启动MySQL服务器,这样以便于MySQL在系统启动时自动启动
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start
为MySQL root帐户设置密码
mysql_secure_installation
会出现下面的一系列提示:
root@server1 ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] <-- ENTER
New password: <-- yourrootsqlpassword
Re-enter new password: <-- yourrootsqlpassword
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
proction environment.
Remove anonymous users? [Y/n] <-- ENTER
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] <-- ENTER
... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a proction environment.
Remove test database and access to it? [Y/n] <-- ENTER
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] <-- ENTER
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
[root@server1 ~]#

CentOS 6.2下安装Apache
3.安装阿帕奇2
Apache2的是作为一个CentOS的软件包,因此我们可以直接用下面命令安装它:
yum install httpd
现在配置系统在引导时启动Apache
chkconfig --levels 235 httpd on
并启动Apache
/etc/init.d/httpd start
现在,您的浏览器到http://192.168.0.100,你应该看到Apache2的测试页:

Apache 2测试网页
Apache的默认文档根目录是在CentOS上的/var/www/html 目录 ,配置文件是/etc/httpd/conf/httpd.conf。配置存储在的/etc/httpd/conf.d/目录。
4.安装PHP5
我们可以用下面的命令来安装PHP5
yum install php
安装完需要重启
/etc/init.d/httpd restart

CentOS 6.2下安装PHP5
5.我们可以安装PHP5和Apache的PHP5的模块如下:
默认网站的文件根目录是在/srv/www/html中。现在我们将在该目录中创建一个小型PHP文件(info.php的)在浏览器中调用它。该文件将显示很多关于我们的PHP安装,如安装的PHP版本和有用的一些细节。
vi /var/www/html/info.php

修改细节
现在,我们可以用浏览器访问例如http://192.168.0.100/info.php文件

PHP页面
正如你所看到的,PHP5的工作,它通过Apache 2.0的处理程序,在服务器API线。如果你继续向下滚动,你会看到所有在PHP5中已经启用的模块。MySQL是没有列出,这意味着我们没有在PHP5支持MySQL。
6.PHP5获得MySOL的支持
让PHP在MySQL中获得支持,我们可以安装的php-mysql软件包。安装一些其他的PHP5模块,以及您可能需要的应用程序,这是一个好主意:
yum search php
还安装需要安装的
yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc
现在重新启动Apache2的:
/etc/init.d/httpd restart
现在,重载http://192.168.0.100/info.php在您的浏览器,并再次向下滚动到模块部分。现在,你应该找到许多新的模块,包括MySQL模块:

MySQL页面

CentOS 6.2下安装phpMyAdmin
7.安装phpMyAdmin
phpMyAdmin是一个网络接口,通过它可以管理你的MySQL数据库
首先,我们使CentOS系统RPMForge软件库的phpMyAdmin,而不是官方的CentOS 6.2库:
所以需要导入RPMForge的GPG密钥:
rpm --import
x86_64系统:
yum install
在i386系统:
yum install
安装phpmyadmin
yum install phpmyadmin
现在我们可以设置phpMyAdmin,了我们可以改变Apache的配置来让phpMyAdmin不仅仅只能从localhost登录。
vi /etc/httpd/conf.d/phpmyadmin.conf

配置
下一步,我们从HTTP改变的phpMyAdmin的cookie来身份验证:
vi /usr/share/phpmyadmin/config.inc.php

修改身份验证
重启阿帕奇
/etc/init.d/httpd restart
在地址栏输入http://192.168.0.100/phpMyAdmin/:你就可以访问phpMyAdmin了。

phpmyadmin页面
CentOS可以得到RHEL的所有功能,甚至是更好的软件。但CentOS并不向用户提供商业支持,当然也不负上任何商业责任。
如果你要将你的RHEL转到CentOS上,因为不希望为RHEL升级而付费。当然,你必须有丰富linux使用经验,因此RHEL的商业技术支持对你来说并不重要。但如果你是单纯的业务型企业,那么还是建议你选购RHEL软件并购买相应服务。这样可以节省你的IT管理费用,并可得到专业服务。

❻ linux中如何实现用java写一个http服务器,本人新手一枚,不知道从哪里开始

建议你系统学习下:
1.java基础
2.sevlet
3.jsp
4.tomcat
5.mysql
6.ssh框架
7.ssm框架
这些内容网上都有免费教程

❼ 阿里云linux系统搭建好了HTTP服务器 现在要做个项目让人可以下载 我自己放的东西 项目怎么写

你们公司有人懂架设,没有就找网络公司买空间或服务器,因为买了空间或服务器就要把程序架设上去,在做域名解析,你们公司没人懂操作,你买了也是没有办法用。还有你们公司是企业网站,建议买空间,一年才两三百,买服务器一年最少要七八百,还要有人管理,很麻烦的。

❽ linux怎样安装http服务

可以查看所有的服务。看看其中是否有httpd即可。httpd是http服务的守护进程。可以参考如下Web服务器的建立过程。示例环境及web服务器软件:LAMP(Linux,Apache,Mysql,PHP)(1)、下载安装mysql-5.5.25.tar.gz,默认安装位置/usr/local/mysql/

❾ 如何在linux系统搭建http服务

1、安装ftp服务端,方便你从客户端上传文件。linux上一般安装vsftp.VSFTP的软件安装包是: vsftpd-2.2.2-12.el6_5.1.i686.rpm
查询:#rpm -q vsftpd
安装:#rpm -ivh vsftpd-2.2.2-12.el6_5.1.i686.rpm或者直接yum install vsftpd
启动、停止及重启VSFTP的命令: #service vsftpd start/stop/restart
配置文件:
/etc/vsftpd/vsftpd.conf //主配置文件
/etc/vsftpd.ftpusers //被禁止登录FTP的用户文件
/etc/vsftpd.user_list //允许登录FTP的用户文件
a、将登录后的用户限制在本地家目录下:
#vi /etc/vsftpd/vsftpd.conf
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
新建受限用户的列表文件并加入受限用户名
#vi /etc/vsftpd.chroot_list
raykeso
重启ftp服务
#service vsftpd restart
2、安装apache,开启目录索引,这样你就可以浏览和下载文件。
apache配置文件
<Directory "I:/build/dist"> #设置浏览文件的目录
Options Indexes #开启目录列表索引模式Order allow,deny
Allow from all
</Directory>

❿ 如何得知LINUX服务器上安装了什么HTTP服务器

这个得根据情况,如果web服务器是开启的,直接ps查进程即可

如果没有开启就需要全盘检索,找一些常用的目录来看安装的是什么web服务器了。

热点内容
iphone存储空间自动 发布:2024-04-28 07:40:11 浏览:953
培训php还是java 发布:2024-04-28 07:10:49 浏览:919
dal数据访问 发布:2024-04-28 07:09:00 浏览:522
python判断服务器是内网地址 发布:2024-04-28 07:07:17 浏览:782
手机qq影音加密 发布:2024-04-28 07:05:27 浏览:781
多次编译仍然启动不了 发布:2024-04-28 06:33:17 浏览:599
绝地求生怎么调服务器2020 发布:2024-04-28 06:28:14 浏览:803
虚拟主机和轻云服务器 发布:2024-04-28 05:34:20 浏览:775
电脑服务器的品牌型号怎么查 发布:2024-04-28 04:33:06 浏览:138
文件上传ui 发布:2024-04-28 04:07:14 浏览:483