scripts ??

Discussion in 'Installation/Configuration' started by drahcir77, Feb 10, 2011.

  1. drahcir77

    drahcir77 New Member

    I have put some javascript into my web site. it works just fine if I leave the *js files in the root of my website. but I wanted to put the javascript files in a folder (directory) called javascript. when I do that the scripts will not work.

    any suggestions on how to make the javascript work when in the new directory ?

    I have tried ./javascript/javascript.js

    I am sure it is a permissions problem with my ubuntu 10.10 perfect server running apache 2.2.16 . I still don't understand something, sorry
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. drahcir77

    drahcir77 New Member


    I get an error 403 , and the java:(:(:(script does not work.

    if I put the script into the website directory the javascript works,, go figure
  4. kwickcut

    kwickcut Member HowtoForge Supporter

    dont know if this will help u but are you prefixing the package name before the class.

  5. drahcir77

    drahcir77 New Member

    No Clue

    I have not a clue of what you speak, what package ??

    this is how I call the javascript
    <script type="text/javascript" src="accordion.js"></script>

    if I need more somewhere, I don't know where it is.

    thanks for the answer
  6. falko

    falko Super Moderator ISPConfig Developer

    Are there any errors in Apache's error log?

    What are the permissions of the folder where you put the script? Is it inside the document root?
  7. otacon

    otacon New Member

    is the html file that calls the .js in the javascript folder or in some other folder.

    If it is just in the root then you need to:

    <script type="text/javascript" src="javascript/accordion.js"></script>

    If it is another sub folder just like javascript then you need to try:

    <script type="text/javascript" src=""></script>

    Also if that does not work, then put a html file in the javascript folder and see if you can reach it, so as to determine if it is a permissions issue in general or just with .js files.
  8. drahcir77

    drahcir77 New Member

    ooops I was not clear

    <script type="text/javascript" src="javascript/accordion.js"></script> is what I did at first, the javascript file was in a subdirectory of the website called javascript. When I put the accordion.js and jquery.js in the same directory as my web site it all works, but as soon as I try to use the javascript folder then nothing works and I get a 403 error.

    I had a somewhat the same problem with a cgi script that I never got to work. I am sure I have something wrong with my settings on website , just don't know where to look
  9. falko

    falko Super Moderator ISPConfig Developer

    Are there any errors in Apache's error log?

    What are the permissions of the folder where you put the script? Is it inside the document root?
  10. drahcir77

    drahcir77 New Member

    /var/www/clients/client1/web1/web is document root

    is where I want to put the javascripts

    permissions are 755 currently on the javascripts directory
  11. falko

    falko Super Moderator ISPConfig Developer

    What are the outputs of
    ls -la /var/www/clients/client1/web1/web/javascript/
    ls -la /var/www/clients/client1/web1/web/
  12. drahcir77

    drahcir77 New Member

    did the requested

    here is the results of your request, where can I go on the internet to be able to figure out what all that means ?

    Attached Files:

  13. yucktoufoo

    yucktoufoo Member

    That is just a directory listing run

    man ls
    To get more info on what each of the fields are.

    That all looks ok, although you shouldnt need 777 permissions on those js files, the server does not need to execute them, only serve them.

    Here is mine...

    -rw-r--r-- 1 web2 client2  3379 Feb 14 14:17 main.js
    I recommend that you chmod those files 644 but thats unlikely to fix your problem.

    It's not something daft like an alias declaration in apache for /javascript or something?

    As one of the other members said, you need to look at the apache error logs for more clue.
  14. germinator

    germinator New Member

    if i understood correctly, you want to have the javascript flies in

    and want to use them from

    then your declaration is incorrect,
    yours is
    <script type="text/javascript" src="javascript/accordion.js"></script>
    but if my thought are right you need the ../ before the javascript .. like so
    <script type="text/javascript" src="../javascript/accordion.js"></script>
  15. drahcir77

    drahcir77 New Member

    well, great try but it still does not work. I guess I will give up on this and just do more study until I figure it out

    thanks for the help
  16. falko

    falko Super Moderator ISPConfig Developer

    Your /var/www/clients/client1/web1/web/ directory has permissions of 710 and is owned by web1:client1 which means the Apache user has no read access to it. Please try
    chmod 755 /var/www/clients/client1/web1/web/
  17. drahcir77

    drahcir77 New Member

    Thanks Falco, that did not work either, I am sure I have something wrong is setup somewhere. I will give up for not and just put the script's in the same directory as the pages. It was a good idea but I don't want to take your time anymore

    Thanks Tons for the help
  18. marker

    marker New Member

    scripts?? -solved?

    The javascript directory puzzle drove me nuts as well. An extensive Google search led me to the following:

    It turns out that in Apache 2.2 the following file:

    /etc/apache2/conf.d/javascript-common.conf contains:

    Alias /javascript /usr/share/javascript/
    <Directory "/usr/share/javascript/">
    Options FollowSymLinks MultiViews

    When you comment this out, you can run .js scripts from the /javascript subfolder in your websites of choice...

    Perhaps something to add to the "Perfect..." guidelines!
  19. drahcir77

    drahcir77 New Member

    OH My Goodness, what a wonderful find. Thank YOU !! so much , will try it in the am.. will change directory name and will see, that way I don't have to remove anything.
  20. drahcir77

    drahcir77 New Member

    I changed my directory name to javascriptdir and all started working, thank you so much. I don't think I would have ever found that one


Share This Page