I have a Ubuntu server with 2 websites on it. I can navigate to one, but not to the other. Here are the details:
Each website has a user with the same name as the group and as the subfolder. Sites are hosted under
/home/site1/public_html and
/home/site2/public_html
Now in my case site1 is called from a subdomain, but it works just fine, so if I navigate to site1.mydomain.com it opens up the CodeIgniter page and I can navigate with no issues (I have .htaccess here to get rid of index.php in the url).
However when I try to navigate to www.site2.com which points to /home/site2/public_html it gives me a 404 error. So to troubleshoot, I added a /home/site2/public_html/index.html simple file and I can see that if I navigate to www.site2.com, however I can't see it if I navigate to www.site2.com/index.html. Also, in my case, I have a subfolder (with same name as the site = "site2") where CodeIgniter code/folder structure is and I just can't get tot that index.php from code igniter at all (path to it is /home/site2/public_html/site2/index.php). I tried to navigate as www.site2.com/site2/index.php or www.site2.com/index.php with or without htaccess file but with no help. I tried to remove the .htaccess in this site, I tried to create a test.html in /home/site2/public_html/site2 but I can't navigate to it, I get 404 if I do www.site2.com/site2/test.html
in terms of user access I used $ chmod -R 755 /home/site2
Is it an access right that I am missing? Or a conflict with the other .htaccess from the other virtual folder? No clue... and I am just running out of ideas
V Host Settings
ServerName site1.mydomain.com
ServerAlias site1.mydomain.com
DocumentRoot "/home/site1/public_html"
<Directory "/home/site1/public_html">
AllowOverride All
allow from all
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>
and for the one I've trouble with
ServerName www.site2.com
ServerAlias www.site2.com
DocumentRoot "/home/site2/public_html"
<Directory "/home/site2/public_html">
AllowOverride All
allow from all
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>
NOTE : I just made a subdomain site2.mydomain.com (domain registered with FatCow) and that seems to be working, it does not work only when I call it with www.site2.com (register under GoDaddy - which gives a GoDaddy "Destination unknown" page which I assumed it is a 404 error and always asks me to Accept cookies ... and I am on a diet :P )
Thanks anyone in advance!
oh darn thing, you were right #sintakonte, one site was pointing somewhere else. Go daddy had a A record with old IP address, I added another A record and asked them to park the original (as I had no rights to do so from their website). And problem got resolved. Thank you!
Related
I successfully installed Laravel and Laravel Nova in live server but when I tried to view Nova login page, I get index of/nova page and the page does not redirect any css.
Below is the screenshot of the page rendering:
In the config/nova.php the path is correctly set to:
config/nova.php
I need help to get this page to display correctly.
I found what the problem was. I got index of/nova because Laravel Nova login page was looking for the css folder, js folder, .htaccess, web.config from the root directory and it could not find then it displays index of/nova.
When I moved css folder, js folder, .htaccess, web.config to the root directory, then voila I get the login exactly as I wanted.
Below is the correct display of laravel login page:
Thanks everyone who tried their best to help.
In your case the problem might not be with the web application but with the settings of the webserver.
I use Apache and this is what my 'virtual hosts' (httpd-vhosts.conf) configuration looks like for one web application:
<VirtualHost *:80>
ServerName laraveltest1
DocumentRoot "c:/users/jorisj1/source/repos/laraveltest1/public"
<Directory "c:/users/jorisj1/source/repos/laraveltest1/public">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
In your case the DocumentRoot might point to the actual root of the application. Try changing it to the public directory.
I've created a blog, it's a homework of my web application class. The teacher asked us to host it. I'm the only one who have decided to host the server at my own PC, which is always switched on.
I'm running this server in Windows 10. I'm using XAMMP.
I've created a domain name at no-ip.com. After hours of fighting against the configurations, I've got the website working in my computer, in my LAN and finally, the whole Internet too.
I know the worst have been over. So it's just a silly thing I want to fix. I have my website inside this directory: C:\xampp\htdocs\wordpress
If I want to access to it, I must write http://IP/DNS.ddns.net/wordpress
I want to get rid of the "/wordpress"
I would like to access to my website with the specific ddns I have created without having to type /wordpress at the end.
I'm sure this have a name but I can't guess it right now, and I don't know how to configure this for Windows 10. I'm still learning it in another subject, but it's for Linux and Windows Server (IIS). The most alike is Linux (Apache) but the files and directories are different.
Can you help me, please? Thanks in advance!
You should set DocumentRoot variable]1 in apache to the proper path.
For example if you have
DocumentRoot "c:/www"
<Directory "c:/www">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
You should edit it to be
DocumentRoot "c:/www/wordpress"
<Directory "c:/www/wordpress">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
And restart apache
So i have a website in which there is a form where users fill their details and we have a functionality where the users subsite will gets automatically created for them.
For example, user registers with newres as his username then we create a subsite for them on newres.crm.nadsoftpro.info.
We are using apache server. The general functionality is we dynamically create a virtual host entry through php. We then also create a directory for them in the /var/www/html/ folder dynamically. We then enable the site in the back end and restart the server automatically through cron, so newly added subsite can run without doing manual server restart.
The problem is sometime the subsite gets creates without any issues and loads smoothly. But sometime it does not load. I can see the virtual host is there, directory is there in html folder but when i hit the url in the browser, it just shows the blank page. (Screenshot: https://www.screencast.com/t/y2z41cr4tVVm). While other website is loading correctly through the same script: http://gaurav.crm.nadsoftpro.info.
Here is the virtual host entry for this:
<VirtualHost *:80>
UseCanonicalName Off
ServerName newres.crm.nadsoftpro.info
ServerAlias newres.crm.nadsoftpro.info
VirtualDocumentRoot /var/www/html/newres.crm.nadsoftpro.info
<Directory /var/www/html/newres.crm.nadsoftpro.info/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Can someone please help me to figure out what i am missing?
Thank you.
I have uploaded all my project files onto my cloud machine in the drectory /var/www/html/.
When I visit the IP address of this machine through a browser, it shows me the expected page, which routes to MyCtrl/index.
However, if I manually go to IPAddr/MyCtrl/index, I get an apache server 404 error.
None of the other routes work either. eg. IPAddr/MyCtrl/someOtherAction results in a 404 as well.
The fact that the homepage loads means that the default configuration for MyCtrl/index is working, but maybe URL rewriting is not being done right?
Can someone tell me whether the problem is with my bootstrap.php file or with my .htaccess file, along with a possible fix?
It's the first time I'm deplying an application onto a cloud machine, so I'm not really sure what the problem is.
So if anyone has the same issue, here's the fix:
(This is considering that all project files are in /var/www/html/
Changes have to be made in /etc/apache2/apache2.conf
From:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
To:
<Directory /var/www/>
Options All
AllowOverride All
Require all granted
</Directory>
This answer helped me out:
Kohana The requested URL /home was not found on this server
I am not sure why this is happening as I am not very knowledgeable when it comes to Apache. Below is a copy of my VirtualHost.
If this gives any extra help as to how to get it to work, I am trying to run a CakePHP site. I know the site itself has no issues as I have another location I manage the code from and can get it running locally through Apache there.
<virtualhost *:80>
DocumentRoot "C:/sites/sitename"
ServerName dev.sitename.com
ErrorLog "logs/sitename.com-error.log"
CustomLog "logs/sitename.com-access.log" common
<directory "C:/sites/sitename">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Allow,Deny
Allow from all
</directory>
</virtualhost>
I am running this on Apache 2.0 and Win7sp1
UPDATE
I never found the real solution using the route I was on. I downloaded a fresh copy of WAMP and was soon able to get everything up and running, no problem.
In order to prevent apache from showing the directory listing, you need to disable indexes. Also, it's best to disable MultiViews as that will enable content-negotiating, which may produce unwanted side-effects
Change the options to;
Options -Indexes FollowSymLinks
Then, check that the .htaccess file is present inside your webroot (C:/Sites/Sitename), as that file is used to enable mod_rewrite
Additional pointers/hints
First of all, make sure that the DocumentRoot is pointing to the right directory of your application;
The standard directory structure of CakePHP looks like this;
app
/Config
/Controllers
/Views
......
/webroot
lib
/Cale
plugins
The DocumentRoot should point to your `app/webroot' directory, which contains all 'public' files.
Change the paths/directories in your virtual host to that directory and restart Apache.
If you're still getting a 403 error, change the URL you're visiting in your browser to this;
http://mywebsite.com/index.php
If this does work, check if the .htaccess file is present in that directory and mod_rewrite is installed in your Apache.
According to the answer from "thaJetzah" (sorry, can't comment yet:) )
403 Forbidden is better than having the index of the folder, because now you can see the logs/sitename.com-error.log log and hopefully it tells you, why it gives 403.
Just to make sure: The index.php is in the folder "C:/sites/sitename"?
If you can't isolate the error like this, it would be great to post here the output of the error.log when you try to access the page and it gives you 403.
Check this If you are running Ubuntu.