1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Apache newbie, it can't find my site's resources

Discussion in 'Apache' started by Ray Silva, Jun 6, 2019.

  1. #1
    Ok, I made a small Phaser game. I can run it on simple php server with php -S localhost:8000 command from terminal. Then over to localhost:8000 on either Chrome or Firefox and it runs.

    Now, I decided to install Apache. I did it with XAMPP. Everything runs fine, but then comes my problem. From what I read, I need to copy my small site into the Apache htdocs folder. Well, the original installation has an Apache dashboard and stuff there. I read that I could create a directory inside htdocs. I did, naming it /my/. Then my small site went in there.

    I changed the default localhost port to 82 because something else was using 80. It worked fine for the default Apache site in htdocs. To address my site I went to localhost:82/my/. Both browsers tell me in the console window that Apache is unable to find images and sounds that are in /res/imgs and /res/snds folders.

    The message in the console says it was unable to load the files from localhost:82/res/snds and localhost:82/res/imgs. It appeared to ignore that the files were in a folder inside htdocs named /my/, but maybe that's some technicality. I don't know how it works exactly.
    SEMrush
    What I did was temporarily rename the original htdocs folder and create a new one into which I directly put my game site. Now both browsers find the site OK. Is there some simpler way of doing this without those errors? Am I totally missing something?
     
    Solved! View solution.
    Ray Silva, Jun 6, 2019 IP
    SEMrush
  2. #2
    Some parameters you have to set in Apache config examples :

    “DocumentRoot “C:/dev/progs/Apache/htdocs”” and replace it with your actual “DocumentRoot “C:/dev/www”“

    “<Directory “C:/dev/progs/Apache/htdocs”>” and replace it with “<Directory “C:/dev/www”>“

    “Options Indexes FollowSymLinks” and replace it with “Options Includes Indexes FollowSymLinks MultiViews“

    “AllowOverride None” and replace it with “AllowOverride All“

    “DirectoryIndex index.html” and replace it with “DirectoryIndex index.html index.htm index.php“

    “AddType application/x-gzip .gz .tgz” do not replace anything, just add new line below this line with text “AddType application/x-httpd-php .php“

    hope this helps :)
     
    hostechsupport, Jun 7, 2019 IP
  3. Ray Silva

    Ray Silva Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    WOW, awesome reply! I set it as "Best" even though it's the only
     
    Ray Silva, Jun 7, 2019 IP
  4. Ray Silva

    Ray Silva Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    OK, Yikes, I did all of those as below and then Apache would not start, giving error message through XAMPP. There were no Windows Event Logs. Nothing in the XAMPP Apache error log either. This is the main window error:

    12:54:41 PM [Apache] Attempting to start Apache app...
    12:54:41 PM [Apache] Status change detected: running
    12:54:42 PM [Apache] Status change detected: stopped
    12:54:42 PM [Apache] Error: Apache shutdown unexpectedly.
    12:54:42 PM [Apache] This may be due to a blocked port, missing dependencies,
    12:54:42 PM [Apache] improper privileges, a crash, or a shutdown by another method.
    12:54:42 PM [Apache] Press the Logs button to view error logs and check
    12:54:42 PM [Apache] the Windows Event Viewer for more clues
    12:54:42 PM [Apache] If you need more help, copy and post this
    12:54:42 PM [Apache] entire log window on the forums

    These were the changes I made. I left the old with a preceding #.

    Your suggestion:
    “DocumentRoot “C:/dev/progs/Apache/htdocs”” and replace it with your actual “DocumentRoot “C:/dev/www”“
    My comment: My document root was "C:/I had no such directories as dev/www, but I first created them...
    Your suggestion:
    “<Directory “C:/dev/progs/Apache/htdocs”>” and replace it with “<Directory “C:/dev/www”>“
    My comment: I did that
    Your suggestion:
    “Options Indexes FollowSymLinks” and replace it with “Options Includes Indexes FollowSymLinks MultiViews“
    My comment:
    was actually "Options Indexes FollowSymLinks Includes ExecCGI". I hashed it out and replaced it with your suggestion
    Should it have been "Options Indexes FollowSymLinks Includes MultiViews"? Is the exact syntax important?
    “AllowOverride None” and replace it with “AllowOverride All“
    Your suggestion:
    “DirectoryIndex index.html” and replace it with “DirectoryIndex index.html index.htm index.php“
    MY comment: This was already there (and had worked) so I left it alone seeing that it included both index.htm and index.php
    <IfModule dir_module>
    DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
    default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
    home.php home.pl home.cgi home.asp home.shtml home.html home.htm
    </IfModule>
    Your suggestion:
    “AddType application/x-gzip .gz .tgz” do not replace anything, just add new line below this line with text “AddType application/x-httpd-php .php“
    My comment: these were already there
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php
    I hashed the first one...

    Now Apache doesn't work at all.
    I just saw that there was an original copy of the httpd.conf file in XAMPP/apache/conf/original, but when I looked at it it was completely different from my original. It seems to be for a Linux system, not Windows. Nothing works. Should I try to completely reinstall XAMPP again?
     
    Ray Silva, Jun 7, 2019 IP
  5. hostechsupport

    hostechsupport Well-Known Member

    Messages:
    411
    Likes Received:
    23
    Best Answers:
    7
    Trophy Points:
    138
    #5

    >> Thanks for your kind Appreciation @Ray Silva :)
     
    hostechsupport, Jun 7, 2019 IP
  6. Ray Silva

    Ray Silva Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #6
    Sorry, I pressed "Best Answer" before I tried it.

    It didn't work.

    In fact, Apache is now worse than ever and I can't get back to where it was working before even with the problem I asked about.

    It's not working at all.

    Since I've gotten no reply back, I'm going to try to completely reinstall XAMPP.
     
    Ray Silva, Jun 8, 2019 IP