how to have customisable wamp url - wordpress

<VirtualHost *:80>
DocumentRoot "C:\wamp\www\TEST1\wordpress"
ServerName yg8i.tk
ServerAlias www.yg8i.tk
Options Indexes FollowSymLinks
<Directory "C:\wamp\www\TEST1\wordpress">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
but this will only give them my wordpress website and also if someone types www.yg8i.tk/whatever they will have access to my files.
and i also want to have custom urls so for example i would like to type www.yg8i.tk/login to login to my wordpress site so my solution was
<VirtualHost *:80>
DocumentRoot "C:\wamp\www\TEST1\wordpress\wp-login.php"
ServerName yg8i.tk\login
ServerAlias www.yg8i.tk\login
Options Indexes FollowSymLinks
<Directory "C:\wamp\www\TEST1\wordpress\wp-login.php">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
but it does not work i really need ur help.
I Hope You Help And Thank You In Advance.

Try changing to this, DocumentRoot and <Directory... can only have a directory as their value.
You can use the DocumentIndex to cause any other script to be launches
<VirtualHost *:80>
DocumentRoot "C:\wamp\www\TEST1\wordpress"
ServerName yg8i.tk\login
ServerAlias www.yg8i.tk\login
Options Indexes FollowSymLinks
DocumentIndex wp-login.php
<Directory "C:\wamp\www\TEST1\wordpress">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Related

I got server error when using Bitnami Wordpress

I manage 3 websites on one server instance. I set the Bitnami.conf like below
<VirtualHost *:80>
ServerName morethanair.com
ServerAlias morethanair.com
DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
<Directory "/opt/bitnami/apps/wordpress/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
# Bitnami applications installed with a prefix URL (default)
Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
</VirtualHost>
<VirtualHost *:80>
ServerName microblog.morethanair.com
DocumentRoot "/opt/bitnami/apps/wordpress/microblog-wordpress/"
<Directory "/opt/bitnami/apps/wordpress/microblog-wordpress/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
# Bitnami applications installed with a prefix URL (default)
Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
</VirtualHost>
<VirtualHost *:80>
ServerName photo.morethanair.com
DocumentRoot "/opt/bitnami/apps/wordpress/photo-wordpress/"
<Directory "/opt/bitnami/apps/wordpress/photo-wordpress/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
# Bitnami applications installed with a prefix URL (default)
Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
</VirtualHost>
I can connect 2 sites with subdomain (photo.morethanair.com and microblog.morethanair.com), but the server error occurred when I try to connect morethanair.com.
When I type 'morethanair.com' in the browser, the URL changes to 'morethanair.com//' with double slash.
Any idea to resolve this?
I already tried to delete Wordpress and all plug-ins and reinstalled the latest Wordpress, but it didn't work.
Thank you.

Create website conf with 2 virtual hosts

I want to know if it's possible to have one apache website conf file with two vhost inside ?
More clearly :
For now if I access my website like this : XX.XX.XXX.XX I reach my wordpress folder.
Now, I want to access another folder like this : XX.XX.XXX.XX/interface
Is it possible to do it in the same conf file ?
Here is mine actually :
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/wordpress/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/wordpress/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
Thanks in advance

VirtualHost sets the url as abc.com/subdirectory/

<VirtualHost *:80>
ServerAdmin xxx#abc.com
ServerName abc.com
ServerAlias www.abc.com
DocumentRoot /var/www/html/wordpress/
<Directory /var/www/html/wordpress/>
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
ErrorLog /var/logs/error_wp.log
CustomLog /var/logs/access_wp.log combined
</VirtualHost>
I had issues with Wordpress url, then I changed the url to abc.com and now Wordpress renders all pages correctly.
But when it comes to homepage, abc.com, it redirects to abc.com/wordpress/
So whenever I type abc.com in a browser, it redirects to abc.com/wordpress/
And it says "Oops! That page can’t be found."
Wonder where the issue might be.
I'm using default .htaccess for Wordpress. I use a static homepage. Except homepage all other pages work properly. I am able to login using abc.com/wp-admin/
Thanks in advance.
Your directory block should list the path relative to the root, not the absolute path. See if this fixes it:
<Directory />
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
Also, you shouldn't include a trailing slash with your document root.
DocumentRoot /var/www/html/wordpress
Here's the entire corrected config file:
<VirtualHost *:80>
ServerAdmin xxx#abc.com
ServerName abc.com
ServerAlias www.abc.com
DocumentRoot /var/www/html/wordpress
<Directory />
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
ErrorLog /var/logs/error_wp.log
CustomLog /var/logs/access_wp.log combined
</VirtualHost>
The problem was pretty silly. I had set a static page as homepage, which had an entry in db as abc.com/wordpress/. So everytime I click homepage, it would search for abc.com/wordpress/wordpress, which doesn't actually exist.

I'm trying to use my other domain

I just got a new domain and i'm trying to use it for a different site but I can't get it to work. It still sends me to my other domain name instead. I try to look it up how to do it but I can't find away to do it, What should I do?? Here is the code,
ServerName dstokesncstudio.org
<VirtualHost 69.132.203.191:80>
ServerName dstokesncstudio.org:80
ServerAlias www.dstokesncstudio.org
DocumentRoot "C:/htdocs/www/dstokesncstudio"
DirectoryIndex index.html
TransferLog "C:/htdocs/www/dstokesncstudio/logs/access.log"
ErrorLog "C:/htdocs/www/dstokesncstudio/logs/error.log"
<Directory "C:/htdocs/www/dstokesncstudio">
DirectoryIndex index.html
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
ServerName dejesusconstruction.com
<VirtualHost 69.132.203.191:8080>
ServerName www.dejesusconstruction.com:8080
ServerAlias www.dejesusconstruction.com
DocumentRoot "C:/htdocs/www/dstokesncstudio/jesus"
DirectoryIndex index.html
<Directory "C:/htdocs/www/dstokesncstudio/jesus">
DirectoryIndex index.html
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 69.132.203.191:80>
ServerName dstokesncstudio.org
</VirtualHost>
<VirtualHost 69.132.203.191:8080>
ServerName dejesusconstruction.com
</VirtualHost>
As
http://ping.eu/nslookup/
say
dstokesncstudio.org => 216.239.38.21,216.239.32.21,...
dejesusconstruction.com => 216.239.38.21,216.239.32.21,...
not 69.132.203.191
I think you want name based virtual hosts https://httpd.apache.org/docs/2.4/vhosts/name-based.html
In your case remove the ServerName ... outside of the VirtualHost ... and add on top
NameVirtualHost *:80
NameVirtualHost *:8080
If you also want to reach the second domain also on port 80 then you dont't need the second line.
Now remove the IP from the VirtualHost as the link above have described and voila you should reach the domains.

Symfony2 project with VirtualHost doesn't work

I'm working on a Symfony2 project (using latest 2.3.2) and for that I made this virtual host:
<VirtualHost *:80>
DocumentRoot /var/www/html/nnplat/web
ServerName nnplat.devserver
<Directory /var/www/html/nnplat/web>
AllowOverride all
Allow from all
</Directory>
ErrorLog logs/nnplat-error_log
CustomLog logs/nnplat-access_log common
</VirtualHost>
If I call http://nnplat.devserver I got this error:
Oops! An Error Occurred The server returned a "404 Not Found".
Something is broken. Please e-mail us at [email] and let us know what
you were doing when this error occurred. We will fix it as soon as
possible. Sorry for any inconvenience caused.
But if I call this URL http://devserver/nnplat/web/app_dev.php it works, where is the problem? I can't find what is wrong in my VH
try this
ServerName nnplat.devserver
<VirtualHost *:80>
DocumentRoot /var/www/html/nnplat/web
<Directory "/var/www/html/nnplat/web">
DirectoryIndex app_dev.php
Options -Indexes FollowSymLinks SymLinksifOwnerMatch
AllowOverride All
Allow from All
</Directory>
</VirtualHost>

Resources