I’m migrating from shared hosting, and trying to test my site on the new DO VPS. When I go to my new IP address, the site loads, but the following resources get a 404 error:
<link href="/javascript/jquery-ui-1.9.2.custom/css/smoothness/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<script src="/javascript/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.js"></script>
<script src="/javascript/dialog/alert_text.js"></script>
Resources in other folders are loading fine; for example, this stylesheet loads without issue:
<link rel="stylesheet" type="text/css" href="/styles/main_style.css">
I have tried deleting my browser cache, as well as using a different browser. The files do exist on the new server in that location. I’ve checked that the folder is correct, and that there aren’t any strange capitalization. Everything is working fine on the old server, and all I’ve done is copy and past to DO.
One thing to note is that I haven’t pointed my DNS to DigitalOcean yet since I’m still testing. So the client browser is loading from MY.IP.ADR.ESS/javascript/… rather than MYDOMAINNAME/javascript/…. Not sure if that has something to do with it.
Thanks for the help!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I’m still struggling with this…
There are no .htaccess files on the server. And the server wouldn’t care if there were, because Alow Override None is set.
I’ve changed my apache2.conf back to the default state to make sure there are no strange <Directory> directives.
I added a <Directory> for the /javascript folder and did Require all granted.
I changed permissions on the /javascript folder to chmod 777 with no effect, then changed back to chmod 755.
I’m restarting the web server after each change, but nothing has any effect. I always get a 403 forbidden error on the /javascript directory, even though the owners and permissions are the exact same as every other directory in my web root.
Is there some way to get more info on the 403 error? Some way to find out why it’s not allowing access?
I found the issue, and it’s a known problem: Ubuntu BUG
The problem was that the folder’s name was “javascript”, and the fix was simply renaming my /javascript folder to /java-script (or anything OTHER than /javascript).
Basically if you have the javascript-common package installed, it generates the following alias:
Alias /javascript /usr/share/javascript
So my WEBROOT/javascript folder was being redirected to /usr/share/javascript, giving the 403 error.
Hope this helps save someone else a few days of troubleshooting!
The issue is fairly straight-forward. On shared hosting, your resources are stored in a different path. Right now, you either don’t have the files downloaded, or have them in /javascript/
Let’s do this. Imagine the pathing like this:
/javascript/jquery-ui-1.9.2.custom/css/smoothness/jquery-ui-1.9.2.custom.css
-> javascript –> jquery-ui-1.9.2.custom —> css ----> smoothness -----> jquery-ui-1.9.2.custom.css
Now, if your files are actually stored in this tree:
-> javascript –> jquery-ui-1.9.2.custom.css
This would mean that it’s looking in the wrong place for your files.
There are 2 options:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.