当前位置:首页 » 操作系统 » linuxapache域名绑定域名

linuxapache域名绑定域名

发布时间: 2022-11-22 14:53:45

linux云服务器怎么绑定域名

1. 登录您的Linux云主机,进入WEB服务器配置文件夹

运行命令:cd /aliyun/webserver/apache2.2.15/conf

2、 备份WEB服务器配置文件;

运行命令:cp httpd.conf httpd.conf.bak

3、 修改WEB服务器配置文件;

运行命令:vi + httpd.conf

4、 添加网站配置信息;

1) 按字母i键,进入编辑模式;

2) 在配置文件末尾,添加

ServerAdmin admin@domain(您的邮箱)

DocumentRoot /alidata/www/wwwroot/phpwind (网站存放路径)

ServerName test.com (网站域名)

ServerAlias www.test.com(网站别名)

ErrorDocument 404 /404.php

DirectoryIndex index.html index.php index.htm

(网站存放路径)

Options +Includes

AllowOverride None

Order allow,deny

Allow from all

3) 保存修改。按ESC键,输入”:wq”后回车;

4) 使配置生效。运行命令:../bin/apachectl graceful

5) 测试网站。请在浏览器中输入域名,测试设置。

推荐使用小鸟云服务器:
小鸟云专注为个人开发者用户、中小型、大型企业用户提供一站式核心网络云端部署服务,促使用户云端部署化简为零,轻松快捷运用云计算。小鸟云服务器全线采用高端Intel Haswell CPU,能够针对企业的不同需求提供多种功能,内存采用最新DDR4内存条,,大大提升数据的访问速度;磁盘采用高速Sas3 SSD高频固态硬盘,可满足Sas接口系统的所有需求,大幅提高用户数据库性能,提高大并发场景下的响应速度,保障高负载下的完美用户体验。

Ⅱ linux服务器如何绑定域名

使用一键安装包配置的apache环境,添加网站配置方法如下:
1.命令:cd /alidata/server/httpd/conf/vhosts/
进入网站的配置文件目录
2.命令:vi aa.conf
创建一个新的配置文件
3.按键盘上的字母 “i” ,开始编辑文件,将下面的内容复制过去。

Order allow,deny
Deny from all

DocumentRoot /alidata/www/test
ServerName www.test.com
ServerAlias test.com

Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all

RewriteEngine On
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2

ErrorLog "/alidata/log/httpd/test-error.log"
CustomLog "/alidata/log/httpd/test.log" common

对应自己的
ServerName www.test.com 绑定的网站域名
ServerAlias test.com 绑定的网站别名(您如果有多个域名添加在这里)没有的话,这个可以删除。
DirectoryIndex index.html index.php index.htm 设置默认首页
DocumentRoot /alidata/www/test 和 Directory "/alidata/www/test" 和 DirectoryMatch "/alidata/www/test/都是指定网站的目录,需要一致。
ErrorLog "/alidata/log/httpd/test-error.log" 和 CustomLog "/alidata/log/httpd/test.log" 对应的日志名字也需要自己修改一下,可以区分网站的日志信息。
4.输入命令:/alidata/server/httpd/bin/apachectl restart 重启apache测试。

Ⅲ Apache怎么样配置绑定域名

http://blog.csdn.net/mayongzhan/archive/2007/12/20/1956214.aspx

前提

俺没有DNS服务.用的是windows.要做虚拟主机

-----------------------------------------------------------------------

首先搞定dns,这个是关键...apache的虚拟主机要有dns的解析才能使用

Win9x中这个文件位于windows目录下,文件名可能是hosts.sam;Win2K及以后的操作系统中这个文件位于WINNT\system32\drivers\etc 目录下,文件名为hosts。

打开就能看到

127.0.0.1 localhost

熟悉吧...这下知道localhost为什么也叫主机了吧

添加一个 test.com和test.myz

这样好象不能用book.test.myz或者news.test.myz...这个就要用dns了...

完成如下:

127.0.0.1 localhost

127.0.0.1 test.com

127.0.0.1 test.myz

-----------------------------------------------------------------------

下面就开始做虚拟主机

我的项目目录D:/马永占

在里面建立两个文件夹做测试

一个叫myz,一个叫myz2

在httpd.conf最后加上,如下....

NameVirtualHost *:80

<VirtualHost *:80>

ServerName test.com

DocumentRoot D:/马永占/myz

</VirtualHost>

<VirtualHost *:80>

ServerName test.myz

DocumentRoot D:/马永占/myz2

</VirtualHost>

别忘了重启apache

然后可以试了

放个index.html在test文件夹下

访问test.com OK

如果出现403,请查看apache中的目录权限设置

出现404,请查看上面写的documentroot是否正确,再看看文件夹里是否有文件....对了,也可以把Include conf/extra/httpd-vhosts.conf前面的#去掉

然后去extra文件夹里找那个文件.在里面写VirtualHost

注意:写了VirtualHost后如果遇到没有的,就默认执行第一个VirtualHost

Ⅳ linux 云主机已经配置了apache 如何绑定域名求命令和步骤。

绑定域名是在apache配置文件里做的,一般vhosts.cfg打开修改就可以。这是做虚拟主机的例子。

Ⅳ linux 如何绑定网站

你好

搭建好操作平台后,以下配置的路径以标准环境路径为准,如果您另行安装,请根据实际安装路径配置。

1.cd /alidata/server/httpd/conf/vhosts/ 进入绑定域名所在目录,

2.vim test.conf 建立一个配置文件,test可以自己命名;

3.点击字母“i”开始编辑文件,输入内容:

<VirtualHost *:80>
DocumentRoot /alidata/www/phpwind
ServerName localhost
ServerAlias localhost
<Directory "/alidata/www/phpwind">
Options -Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
<IfMole mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)/simple/([a-z0-9_]+.html)$ $1/simple/index.php?$2
</IfMole>
ErrorLog "/alidata/log/httpd/phpwind-error.log"
CustomLog "/alidata/log/httpd/access/phpwind.log" common
</VirtualHost>

其中:
ServerName www.test.com 绑定的网站域名
ServerAlias test.com 绑定的网站别名(您如果有多个域名添加在这里)
DirectoryIndex index.html index.php index.htm 设置默认首页
DocumentRoot /alidata/www/test 和 Directory "/alidata/www/test" 都是指定网站的目录,需要一致。

按“esc”退出编辑模式,输入“:wq”保存退出。

4.输入命令:/alidata/server/httpd/bin/apachectl restart 重启apache测试。

5.测试网站。请在浏览器中输入域名,测试设置。

Ⅵ 如何在Linux下使用Apache服务绑定域名

我apache提供web服务。
如果你要绑定域名的话,可以去域名的后台管理进行绑定。如果是在自己的电脑上的话,可以安装dns服务器。

Ⅶ apache下怎么绑定域名啊详细一点

我把我们公司Apache的配置文件粘贴给你看下。我们知道Apache的配置文件位置在/etc/httpd/conf/httpd.conf中,所有的基本配置以及虚拟网站都可以写在这里。

NameVirtualHost*:80
<VirtualHost*:80>
DocumentRoot/home/xwqc/wwwroot
ServerNamexwqc.linux.zhaomuhost.cn
ServerAliaszhaomu.comyourdomain.com
DirectoryIndexindex.phpindex.htmindex.html
ErrorLog/home/xwqc/logfiles/error_log
CustomLog/home/xwqc/logfiles/access_logcommon
</VirtualHost>

其中ServerName是绑定的主域名,ServerAlias中的www.zhaomu.com是绑定的其他附属域名。另外注意配置文件中要设置好端口号,并且关闭服务器防火墙,或者在防火墙上开放80端口后才能正常访问。

Ⅷ linux服务器 Apache服务器如何设置二级域名绑定子目录

首先,解析二级域名,绑定到同一个IP。 假如二级域名是erji.test.com
进入服务器,打开http.conf
一般情况下文档最下面是有一段
#<VirtualHost *:80>

#ServerAdmin .....................
#DocumentRoot /www/docs/..............
#ServerName mmy-host.example.com
#.........
#...........
#</VirtualHost>
把上面一段前面的#号去掉,然后修改DocumentRoot的路径到二级文档的目录,serverName也改一下,然后在中间加一行 ServerAlias erji.test.com

保存 重启httpd

热点内容
内置存储卡可以拆吗 发布:2025-05-18 04:16:35 浏览:331
编译原理课时设置 发布:2025-05-18 04:13:28 浏览:371
linux中进入ip地址服务器 发布:2025-05-18 04:11:21 浏览:606
java用什么软件写 发布:2025-05-18 03:56:19 浏览:27
linux配置vim编译c 发布:2025-05-18 03:55:07 浏览:100
砸百鬼脚本 发布:2025-05-18 03:53:34 浏览:935
安卓手机如何拍视频和苹果一样 发布:2025-05-18 03:40:47 浏览:730
为什么安卓手机连不上苹果7热点 发布:2025-05-18 03:40:13 浏览:798
网卡访问 发布:2025-05-18 03:35:04 浏览:506
接收和发送服务器地址 发布:2025-05-18 03:33:48 浏览:367