我正在嘗試做什麼:將站點(mydomain.com)添加到apache2/sites-available(我已指定其文檔根目錄),然後啓用它並在此之後在我的本地機器上訪問它(如瀏覽器中的mydomain.com)。我有一些以下查詢:virtualhost-mydomain.com在本地機器
- 是否有可能創建一個網站,並給它一個特定的域名(mydomain.com)?
- 我需要遵循什麼步驟來創建一個站點>給一個域>只在本地機器上訪問它。
備註:我有網站的內容。我想創建一個新網站,我不想更改apache的默認網站(即apache2/sites-available/default)。
UPDATE:
我面臨在重新啓動Apache的一個錯誤(如描述我已經添加虛擬主機)
ERROR
CustomLog takes two or three arguments, a file name, a custom log format string or format name, and an optional "env=" clause (see docs)
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
我的網站的文件
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName dev.subhransu.com
ScriptAlias /private /home/hg/repositories/private/hgweb.cgi
<Directory /home/hg/repositories/private/>
Options ExecCGI FollowSymlinks
AddHandler cgi-script .cgi
DirectoryIndex hgweb.cgi
AuthType Basic
AuthName "Mercurial repositories"
AuthUserFile /home/hg/tools/hgusers
Require valid-user
</Directory>
ErrorLog ${APACHE_LOG_DIR}/dev.subhransu.com_error.log
# Possible values include: debug, info, notice, warn, error, cr$
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/dev.subhransu.com_ssl_access.lo$
SSLEngine on
SSLCertificateFile "/etc/apache2/ssl/dev.subhransu.com.crt"
SSLCertificateKeyFile "/etc/apache2/ssl/dev.subhransu.com.k$
</VirtualHost>
httpd.conf文件文件
<VirtualHost *:80>
ServerName dev.subhransu.com
ServerAlias www.dev.subhransu.com
</VirtualHost>
在httpd.conf
你有你的CustomLog指令第二個參數?您虛擬主機中的信息被截斷,所以我無法告訴您在CustomLog指令結束時放置了什麼。下面是一個CustomLog指令的例子:'CustomLog'/path/to/log/file/logs/access.log「combined」 –