vhosts

Selectively redirect to a new domain using apache vhost configuration

☆樱花仙子☆ 提交于 2020-01-06 05:22:10
问题 This is a followup question on Redirect to a new domain using apache vhost configuration I want my requests from somedomain.com/loadproduct?product=dell-inspiron-15 to be redirected to someotherdomain.com/dell-inspiron-15 but selectively for some products which are whitelisted. For example for products : dell-inspiron-15. dell-inspiron-16. dell-inspiron-17 redirect to the new URL but for any other products I want to use the current path itself. Currently my vhost configuration looks like

Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www)

别说谁变了你拦得住时间么 提交于 2020-01-05 04:28:09
问题 I have a custom members system that I have made: Yii2 Members System. You can refer to that for full details, or install it so you can work with it for this question. I have frontend and backend just as Yii2 provides, with a few modifications to separate the sessions/cookies so that backend works with the Admin model and pulls from an admin table. Similar to old traditional member systems. mainsite is basically a clone of frontend and it's role is to be the main website. What you get when you

Wildcard Virtual Hosts Ubuntu

99封情书 提交于 2020-01-03 05:27:12
问题 I'm looking to setup wildcard virtual hosts in Ubuntu. I've set it up on a WAMP setup pretty easily, but I don't know enough about Linux to know how the setup differs. The goal is to be able to create folders like: site.weblocal site2.weblocal site3.weblocal etc..... without having to add individual vhosts each time. Someone has recommended dnsmasq? Any tips would be greatly appreciated :) 回答1: for Ubuntu it goes as simple as sudo apt-get install dnsmasq sudo echo "address=/weblocal/127.0.0.1

PHP cURL doesn't see the /etc/hosts file

浪子不回头ぞ 提交于 2020-01-01 02:35:28
问题 I'm having troubles on making the PHP cURL library recognize the alias I created in my /etc/hosts file. This is what I have in my /etc/hosts file right now: 192.168.0.20 www.example.dev On the other side (192.168.0.20) Apache is configured to run the virtual host on the example.dev domain. The alias works if I test it on my browser but with PHP cURL just doesn't work. The hosts file is on both machines (192.168.0.10 <= PHP cli, 192.168.0.20 <= Apache) . For the sake of completeness this is

Enable Apache site using Ansible

▼魔方 西西 提交于 2019-12-24 17:15:31
问题 I am running a playbook from a python script. I am following this code The following command works perfectly. ansible -i path/to/inventory.yml host_name -m command -a"a2ensite site_name" But when I try to do the same by executing a playbook from the python script. It says the site doesn't exist. Following is the playbook. playbook = dict( name = "Enable Site", hosts = ['token_server'], gather_facts = 'no', tasks = [ dict(action=dict(module='command', args="a2ensite " + site_name), register=

How to correctly set Documentroot in Apache serving Plone

对着背影说爱祢 提交于 2019-12-24 03:18:53
问题 I have a Plone site called example.com located at /var/www/Plone (I think). I have the following settings for the site located in sites-available for vhosts (excerpt): <VirtualHost 10.0.1.4:8082> ServerAdmin webmaster@localhost ServerName wiedhas.noip.me DocumentRoot /var/www/Plone When I try to reach my site wiedhas.noip.me , apache loads the Plone directory tree and not my Plone site. I can browse through the file system of /var/www/Plone but it is not loading the site. I must not have set

How to correctly set Documentroot in Apache serving Plone

时光毁灭记忆、已成空白 提交于 2019-12-24 03:18:50
问题 I have a Plone site called example.com located at /var/www/Plone (I think). I have the following settings for the site located in sites-available for vhosts (excerpt): <VirtualHost 10.0.1.4:8082> ServerAdmin webmaster@localhost ServerName wiedhas.noip.me DocumentRoot /var/www/Plone When I try to reach my site wiedhas.noip.me , apache loads the Plone directory tree and not my Plone site. I can browse through the file system of /var/www/Plone but it is not loading the site. I must not have set

Non-wildcard certificates with dynamic apache vhosts

こ雲淡風輕ζ 提交于 2019-12-24 00:37:29
问题 I'm trying to dynamically read the location of the SSL certificates depending on which url was used to connect to my server. I have attempted a few different ways but none seem to work. Currently I have the config as noted below UseCanonicalName Off listen 443 <VirtualHost *:443> ServerName example ServerAlias * SSLEngine on SSLCertificateFile /etc/letsencrypt/live/%0/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/%0/privkey.pem VirtualDocumentRoot /var/www/vhosts/%-2/%-3+/public <

Bulk 301 redirect from htaccess

女生的网名这么多〃 提交于 2019-12-23 02:59:14
问题 I have spreadsheet which has column of 404 error link and its respective 301 redirects. for e.g) 404 error page 301 redirect http://www.abc.com/1.php http://www.abc/com/2.php .............. ............ The spreadsheet has around 1000+ links. Is there any way in apache config or htaccess where can I handle bulk 301 redirects? 回答1: The best way for a Bulk setting is the RewriteMap directive in mod-rewrite. Note that this will not work in a .htaccess file. You'll need to edit it in a real

How to point all subdomains to index.php [closed]

牧云@^-^@ 提交于 2019-12-22 01:10:02
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I'm trying to host a site on which user profile pages come with unique subdomains, such as username.sitename.com. I would like an Apache/VirtualHost solution for pointing *.sitename.com to sitename.com/index.php,