wordpress site working locally but not from the domain - wordpress

My wordpress site is working locally in my wamp server, this is hosted on an ec2 instance and domain is maintained in Route 53\cloudfare. The domain is working when i checked it using mxtoolbox. The site was working and live till the time i changed my host file in the server. I removed the host file entries accidentally thinking it is a dev site, however i restored it but still the site is not working and i am getting only the "TOO MANY REDIRECTS" error. The following is the current windows host file details
#
127.0.0.1 localhost
::1 localhost
127.0.0.1 mydomain.com
::1 mydomain.com
I restarted the server and WAMP multiple times but it is not working.
The following is my virtualhost configuration
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName mydomain.com
DocumentRoot "c:/wamp/www/sitefolder"
<Directory "c:/wamp/www/sitefolder/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.mydomain.com
DocumentRoot "c:/wamp/www/sitefolder"
<Directory "c:/wamp/www/sitefolder/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require all granted
</Directory>
</VirtualHost>`

Clean your cache and browser history first, then try doing it below:
Open your wordpress admin panel --> Settings--> General --> Make sure it points to the correct domain. --> Save
Or go to the wp-config.php file (Try this if the first method fails / can't be accessed)
add:
define('WP_HOME','http://YourDomain.com');
define('WP_SITEURL','http://YourDomain.com');
or
Try to remove or rename default .htaccess
or
Try to disable the plugin (renaming the plugin folder in the "wp-content/plugin/plugin-folder-name" will non-active that plugin. This might solve the problem if the constraints are due to the plugin)
That's a number of ways when I resolve the ERR_TOO_MANY_REDIRECTS problem. Goodluck

Related

How to configure Reverse proxy for nodejs project and virtualhost for wordpress project

My Objectives:
I want to run the main website like http://dev.abc.com which is a nodejs project I ran the app.js through pm2 and configured the reverse proxy in virtual host in apache which is perfectly working fine.
Here is the code
<VirtualHost *:80>
ServerName dev.abc.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
My second object
There is another project in wordpress which path is /var/www/html/blog
I want to open that blog which is in wordpress setup like http://dev.abc.com/blog
I wrote the code like below
<VirtualHost *:80>
DocumentRoot /var/www/html/blog
<Directory /var/www/html/blog>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
But did not work. whenever I try to hit it http://dev.abc.com/blog it shows 404 not found page.
How to achieve that thing?
Note:
OS Ubuntu 14.05
webserver apache2
nodejs for main website
wordpress for /blog
php 5.6

Error 403 when trying to access localhost

Good morning all.
I run a small in office dev (xampp) server for the build of static and WordPress websites on my Ubuntu machine.
I use vhosts for which two are workingabsolutly fine. However, I have another which for some reason keeps failing when I try to load the site.
My Xampp install is a typical /opt/lampp install, nothing unique or special.
My vhosts File
##Summerschool Development Version (which works fine)
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/summerschooldev"
ServerName summerschoolforteensuk.com
<Directory "/opt/lampp/htdocs/summerschooldev/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
##Summerschool old website (which works fine)
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/summerschool"
ServerName summerschoolold.com
<Directory "/opt/lampp/htdocs/summerschool/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
##scp old website throws error 403 You don't have permission to access / on this server..
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/scp"
ServerName scpold.com
<Directory "/opt/lampp/htdocs/scp/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Now my hosts file
127.0.0.1 summerschoolforteensuk.com
127.0.0.1 summerschoolold.com
127.0.0.1 scpold.com
From what I can see, everything seems to be working fine. Im relativly new to working like this but poor internet speed at my office means I have to. Im guessing that there is not error here as the other two sites work fine.
Is there something Im missing if not where would I look next.
Thanks
I seem to have solved this by installing wordpress locally and importing my database and wp-content folder into the install and using the full domain for the server name and host.
Dont think this has solved my issue but its working now.

Can't get to subsites. Wildcard-subdomains probably misconfigured in Apache

I'm building a portal for the organization I'm working at.
The portal is a Wordpress site using Wampserver 2.5, intalled on a Win server 2008 R2.
It's working fine and accesible from other machines over the intranet, thanks to the helpful and patient RiggsFolly.
But now, I have changed it into a network of sites so that I can build sub-portals for the different departments in my organization.
During that change Wordpress gave this warning message: Warning! Wildcard DNS may not be configured correctly!
Wordpress has a page explaining how to configure wildcard subdomains on Apache - http://codex.wordpress.org/Configuring_Wildcard_Subdomains.
I tried following it but the explanation lacks details and I'm probably doing something wrong.
On the machine where the servers and site are installed, when I write http://hipo (hipo is the current site name) in the browser's address bar, I get to the site fine.
But when I write http://depa.hipo (depa is a subsite I created successfully), the address changes into http://www.depa.hipo/ and the browser says it didn't find a server at that address.
I have probably set the ServerAlias line wrong in httpd-vhosts.conf, and also I didn't add the line *.example.com A 192.0.43.10, or in my case *.hipo A <rightIP>, cause I wasn't sure where to add it in the file.
This is my httpd-vhosts.conf file. Your help is appreciated!
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/hipo"
ServerName hipo
<Directory "c:/wamp/www/hipo">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/hipo"
ServerName subsites.hipo
ServerAlias *.hipo
<Directory "c:/wamp/www/hipo">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
This definition does not have a ServerAlias so try adding one like this:
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/hipo"
ServerName hipo
ServerAlias www.hipo
<Directory "c:/wamp/www/hipo">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

How to point URL path to a wordpress folder

I currently have two sites, hosted on the same server using Apache virtual hosts.
http://www.example.com -> /var/www/sites/mysite (path to main website)
http://blog.example.com -> /var/www/sites/blog (path to wordpress folder)
I need my blog to be accessible from www.example.com/blog
I cannot move the wordpress installation into a 'blog' subdirectory of the mysite folder.
Using the Apache Alias directive, I can do the following in the configuration for www.example.com:
Alias /blog /var/www/sites/blog
and access the blog via www.example.com/blog
However the following fails to work with a 404
www.example.com/blog/a-permalink-post-title
I have also tried using the following but the 404 still persists.
AliasMatch /blog/(.*)$ /var/www/sites/blog/$1
The current virtual host configuration looks like this:
<VirtualHost *:80>
ServerName www.example.com
Alias /blog /var/www/sites/blog
DocumentRoot /var/www/sites/mysite
<Directory /var/www/sites/mysite>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
and for blog.example.com
<VirtualHost *:80>
ServerName blog.example.com
DocumentRoot /var/www/sites/blog
<Directory /var/www/sites/blog>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Would greatly appreciate any help with this.

www being served on iis, non-www being served on apache?

Here is the problem, if you visit the site directorybest.net you will see the correct website (which is defined in apache). But if you go to the www version of the site a catch all site for and from IIS is displayed. I have no idea what this is causing this.
I have another site that already runs fine on apache from which I copied the info for DNS and vhost settings. I also have set the DNS up so that both sites point to the same ip address. Does anyone know why the www version of the site does not show the right website?
Here is the vhost information for both the working and non working site.
NameVirtualHost *
#non-working site
<VirtualHost *>
ServerAdmin admin#email.com
ServerName www.directorybest.net
ServerAlias directorybest.net *.directorybest.net
DocumentRoot "D:\WWW\DirectoryBest\2"
DirectoryIndex index.php
<Directory D:\WWW\DirectoryBest\2>
AllowOverride All
</Directory>
# Logfiles
ErrorLog D:\WWW\DirectoryBest\2\logs\error.log
CustomLog D:\WWW\DirectoryBest\2\logs\access.log combined
</VirtualHost>
#working site
<VirtualHost *>
ServerAdmin admin#email.com
ServerName www.directorybest.info
ServerAlias directorybest.info *.directorybest.info
DocumentRoot "D:\WWW\DirectoryBest\1"
DirectoryIndex index.php
<Directory D:\WWW\DirectoryBest\1>
AllowOverride All
</Directory>
# Logfiles
ErrorLog D:\WWW\DirectoryBest\1\logs\error.log
CustomLog D:\WWW\DirectoryBest\1\logs\access.log combined
</VirtualHost>
Ok so I was just informed that the company has had DNS problems before. And upon further checking the local DNS had not been updated and was still resolving to the old ip address.

Resources