为了提高我的服务器的安全性,我只为admin创build了一个子域名,比如admin.domain.tld ,通常我只通过admin.domain.tld/mysqladmin访问phpmyadmin,就像在configuration文件中一样: <VirtualHost *:80> ServerName admin.domain.tld Alias /mysqladmin /usr/share/phpMyAdmin/ <Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 AllowOverride All […] </VirtualHost> 现在我已经有一个子域我想要SSL安全它,因为我需要configuration一个虚拟主机或类似的东西(我使用certbot aka让我们encryption),但是因为我必须configuration一个虚拟主机,我决定创build一个pipe理员只有在admin.domain.tld包含链接到我的pipe理页面,如phpmyadmin,joomlapipe理页面等html页面… configuration文件: ServerName admin.domain.tld DocumentRoot /var/www/admin.domain.tld ErrorLog /var/log/httpd/admin.domain.tld/error.log <Directory /var/www/admin.domain.tld> Options FollowSymLinks Indexes AllowOverride All </Directory> 但现在当我去admin.domain.tld/mysqladmin我得到一个错误: The requested URL /mysqladmin/ was not found on this server. 所以,我怎么能这样工作: admin.domain.tld是/var/www/admin.domain.tld 和 admin.domain.tld / mysqladmin是phpmyadmin 编辑:我想我的问题是别名不工作,所以当我去admin.domain.tld它显示/var/www/admin.domain.tld/mysqladmin而不是/ usr /共享/ phpMyAdmin
我有一个5个站点的CentOS 6 VPS,让我们encryption安装并在所有站点上运行。 当我访问https:// vps-ip时 ,它总是指向在vhosts-ssl-letsencrypt.conf中configuration的第一个站点(我已经更改了configuration并在configuration的顶部放置了另一个站点来testing它)。 我试着添加: <VirtualHost ip:443> ServerName ip Redirect 403 / ErrorDocument 403 "No" DocumentRoot /usr/local/apache/htdocs UseCanonicalName Off UserDir disabled </VirtualHost> 但网站不能通过SSL访问 or <VirtualHost *:443>… 给我这个错误:[错误]服务器应该是SSL感知,但没有configuration证书[提示:SSLCertificateFile]((null):0) <VirtualHost *>… 不用找了 http:// vps-ip指向正确的vps欢迎页面。 有任何想法吗?
我有这样的configuration: server { listen 80; server_name example.com www.example.com; return 301 https://example.fr$request_uri; } server { listen 443 ssl; root /var/www/example_v2/; index index.php index.html index.htm; server_name example.com www.example.com; return 301 https://example.fr$request_uri; } 当我进入example.com ,它将我正确地redirect到example.fr ,但是当我去www.example.com ,它并没有。 example.com和www.example.com我的DNS转到相同的IP。 有什么可能会出错? 编辑:curl ➜ ~ curl -L -I example.com HTTP/1.1 301 Moved Permanently Server: nginx/1.10.1 Date: Thu, 20 Oct 2016 11:50:38 […]
我试图通过https服务使用nginx的静态文件。 build立 DNS正确地将子域指向AWS IP: subdomain1.website.com -> correct IP 工作configuration 我发现以下简单的服务器设置完全正确工作。 但是,当我修改它转发到https,失败没有错误。 # /etc/nginx/sites-available/default server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name subdomain1.website.com; root /usr/share/nginx/temp-content; index index.html; location / { try_files $uri $uri/ =404; } } 试图redirect到https # /etc/nginx/sites-available/default server { listen 443 ssl; server_name subdomain1.website.com; root /home/deploy/temp-content; ssl_certificate /etc/letsencrypt/live/subdomain1.website.io/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/subdomain1.website.io/privkey.pem; ssl_protocols TLSv1 […]
我正在尝试configuration我的Apache实例来支持各种各样的域结构。 我想要根域,即:example.com和所有* .example.com被定向到一个特定的DocumentRoot。 不过,我有一个警告,我有现有的子域。 即:sub1.example.com sub2.example.com以及sub1.something.example.com,它们具有不同的不同的相应DocumentRoot(除了以sub1开头的情况(例如))。 什么是一个理智的方式来configuration这个? 这甚至有可能吗?
我只需要清除与000-default.conf文件混淆。 我正在按照教程,当它开始谈论默认的虚拟主机文件,它只提到“默认”,而不是000-default.conf“,我想这是默认的虚拟主机文件的新名称? 无论如何,我只是想问一下,如果将000-default.conf文件用作全局虚拟主机文件,那么如果我在那里设置不列出目录或closures版本信息,这将被应用于所有其他虚拟主机? 而且我应该这样做还是那种不好的做法,000-default.conf的主要目的是什么?
我试图解决一个工作正常的Apache实例,直到上周重新启动。 它现在看起来好像虚拟主机没有被加载,我不明白为什么。 任何尝试访问应该转发到虚拟主机的文档根目录的app.domain.com实际上都指向主服务器的文档根目录。 httpd.conf在下面(有一些小的混淆) ServerRoot "/etc/httpd" Listen 80 Include conf.modules.d/*.conf User web-user Group web-group ServerAdmin [email protected] DocumentRoot "/var/www/html" <Directory /> AllowOverride all Require all denied </Directory> <Directory "/var/www"> #Previous value none AllowOverride none # Allow open access: Require all granted </Directory> # Further relax access to the default document root: <Directory "/var/www/html"> Options Indexes FollowSymLinks […]
在我的开发服务器上,仅使用证书login(443上的HTTPS),而80上的HTTPredirect到HTTPS。 没有redirect访问不受限制,每个人都可以去任何地方,因为我不能做“要求”在HTTP上,而不是HTTPS,因为“要求”只适用于LOCATION / FILE而不是VHOST。 可以信任redirect总是拒绝访问HTTP? 它足够安全吗? 相关设置: 在位置/ var / www / html /中: Require All granted Options Indexes FollowSymLinks 在虚拟主机[服务器IP]:80 RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L] 在虚拟主机[服务器IP]:433 SSLVerifyClient require
我在我的服务器上遇到了我的VirtualHostconfiguration问题。 我的服务器运行Ubuntu 14.04.5 LTS(GNU / Linux 4.4.0-31-generic x86_64),Apache / 2.4.7(Ubuntu)。 我已经从这里的其他线程做了很多关于Apache和SNI的阅读,但是我一直没能解决我的具体问题。 我有几个VirtualHostsconfiguration从不同的域,每个都有自己的SSL证书,如下所示: <VirtualHost *:80> ServerAdmin [email protected] ServerName mydomain.com ServerAlias www.mydomain.com DocumentRoot /home/user/mydomain.com/public_html ErrorLog /home/user/mydomain.com/logs/error.log CustomLog /home/user/mydomain.com/logs/access.log combined </VirtualHost> <VirtualHost *:443> ServerAdmin [email protected] ServerName mydomain.com ServerAlias www.mydomain.com DocumentRoot /home/user/mydomain.com/public_html ErrorLog /home/user/mydomain.com/logs/error.log CustomLog /home/user/mydomain.com/logs/access.log combined SSLEngine on SSLCertificateFile /etc/apache2/ssl/mydomain.com.crt SSLCertificateKeyFile /etc/apache2/ssl/mydomain.com.key SSLCACertificateFile /etc/apache2/ssl/mydomain.com.root.crt SSLCertificateChainFile /etc/apache2/ssl/mydomain.com.chain.crt </VirtualHost> <VirtualHost […]
我有一个安装了LAMP的Amazon EC2实例。 我编辑了/etc/apache2/sites-available/000-deault.conf并添加了这个: <VirtualHost *:80> ServerAlias * UseCanonicalName Off LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon CustomLog /var/log/apache2/access.log vcommon VirtualDocumentRoot /var/www/vhosts/%0 </VirtualHost> Listen 443 <VirtualHost *:443> ServerAlias * UseCanonicalName Off LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon CustomLog /var/log/apache2/access.log vcommon VirtualDocumentRoot /var/www/vhosts/%0 </VirtualHost> 当我访问我的域名时,他们指向正确的目录,除了一件事情之外,所有的工作都很好…当我使用www访问域名时。 它给出了这个错误: “未find 在此服务器上找不到请求的URL /。 我的目录结构是/var/www/vhosts/domain.com没有www。 […]