我最近買了一塊linode 1GB的計劃。安裝了Apache,讓我的網站運行起來。 但是我在服務器上安裝了gitlab並將其映射到子域。由於安裝指南建議使用Nginx作爲服務器,所以我安裝了它並運行在80端口上。目前我的apache沒有運行,因爲存在端口衝突。 但我通過編輯/etc/apache2/ports.conf
文件並指示apache服務於不同的端口來修復它。 現在,當我訪問指向端口(8000)的主域並且使用apache不顯示時。 gitlab安裝在http://gitlab.myserver.com
,我能夠訪問它,但如果我嘗試導航到http://myserver.com
,我得到的http://gitlab.myserver.com
Apache上的主域和Nginx上的一些子域
內容我的Nginx下服務gitlab配置如下:。
# GITLAB
# Maintainer: @randx
# App Version: 5.0
upstream gitlab {
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
}
server {
listen my_server_ip default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
server_name gitlab.myserver.com; # e.g., server_name source.example.com;
server_tokens off; # don't show the version number, a security best practice
root /home/git/gitlab/public;
# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
location/{
# serve static files from defined root folder;.
# @gitlab is a named location for the upstream fallback, see below
try_files $uri $uri/index.html $uri.html @gitlab;
}
# if a file, which is not found in the root folder is requested,
# then the proxy pass the request to the upsteam (gitlab unicorn)
location @gitlab {
proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_connect_timeout 800; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://gitlab;
}
}
我的Apache配置爲myserver.com
如下:
# domain: myserver.com
# public: /home/me/public/myserver.com/
<VirtualHost *:8000>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin [email protected]
ServerName www.myserver.com
ServerAlias myserver.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /home/me/public/myserver.com/public
# Log file locations
LogLevel warn
ErrorLog /home/me/public/myserver.com/log/error.log
CustomLog /home/me/public/myserver.com/log/access.log combined
</VirtualHost>
我要去哪裏錯了?
Hi,do你有任何想法如何在Apache上解決這個問題? –