Jump to content

Very Frustrated first time user!


mikeindee
 Share

Recommended Posts

I am writing as a very frustrated first-time user. I'd love to try PW as it seems to be a fabulous CMS but...... every-time I attempt to set-up a 'try-me' site, I hit the same problem. I do *everything* according to the letter. No shortcuts. I'm using a 4GB RaspberryPi running Apache2 as the web server (OK, I know - not the best for a production server, but I'd really like to try this out and I believe it's plenty OK for that). I create a directory (pwire) in the /var/www/html directory and expand the PW zip file there. I open a browser tab via <pi_IP>/pwire and start the installation process, using a default beginner (or intermediate) site. As a series of error messages appear, I fix them. Everything appears to go swimmingly. I connect to a MySQL database. I delete the files and directories I'm advised to. I do absolutely *everything* I'm advised to!! Finally, I get to the last part of the install with two buttons at the bottom of the page. 'Login to admin' and 'view site'. Well, now the fun begins. If I 'view site', I see the home page (Minimal Site Profile). Great! Except NOTHING ELSE works! Nothing! No admin login ("The requested URL was not found on this server.") About - "The requested URL was not found on this server." Site map - "The requested URL was not found on this server.". And this is driving me mad!! Please - there MUST be an easy answer to this. What on earth am I doing wrong? This occurs every time I attempt to install PW so I must be doing *something* wrong!! ANY advice will be profoundly received!!!

Link to comment
Share on other sites

Does your Apache install have mod_rewrite enabled? 

If the home page is loading, but no other URLs are working, it sounds as though URLs are not being parsed.

Also check permissions and ownership on directories and files. Directories should be 755, files 644. 

  • Like 2
Link to comment
Share on other sites

Thanks Chris. I did 'sudo a2enmod rewrite' from a CLI and got 'Module rewrite already enabled'. In fact, I think the PW installation process checks this, and makes you do it. I also checked directories (755) and files (644) as suggested. I restarted apache - no change, I'm afraid! Jeez - why is this SO difficult??

Link to comment
Share on other sites

2 hours ago, mikeindee said:

Great! Except NOTHING ELSE works! Nothing! No admin login ("The requested URL was not found on this server.") About - "The requested URL was not found on this server." Site map - "The requested URL was not found on this server.".

This does seem like an issue with htaccess not kicking in or mod_rewrite, does writing gibberish on the access throw an error? Cheap trick to see if it works ha! ?

  • Like 2
Link to comment
Share on other sites

Thanks Elbax. So, htaccess. I seemed to find a lot of files with this name - in various places. So, I thought - OK, maybe the .htaccess file in the 'root' directory (here /var/www/html/pwire) should be replicated elsewhere? In the 'site' directory? Can't hurt.....can it? Well, yes, 'cos now I get the following error messages if I try and 'hit' the site:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/html/pwire/wire/core/Wire.php on line 485

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/html/pwire/wire/core/WireShutdown.php on line 538

And I thought installing this was going to be easy......? Do you know what - I'm going to delete the entire directory and start again. Let's see what happens. I have a sneaky feeling I'll be back.....again!

 

Link to comment
Share on other sites

OK, here we are again. I deleted the lot and started over. Used the intermediate default site. Did EVERYTHING (well, one exception - no unzip software loaded, but PW said that's OK) as requested and ended up with  the screen #1 below. Now, please, explain how an installer can tell me that everything is OK when it's not? I really appreciate the help, but if there's a problem with .htaccess or mod-rewrite....well, why does PW tell me it's all OK? It's clearly NOT. I am shown NO errors, and so my assumption is that things are good to go? And elabx, how do I 'write gibberish on the access'? What access? What do you mean? I'm happy to stick with this, and learn, but my patience isn't inexhaustible! ? Thanks for all your help - and I just hope that my issues will assist others in the future......

pwire#1.jpg

pwire#2.jpg

pwire#3.jpg

Link to comment
Share on other sites

Thanks Markus and Mats. Markus first. So, I set a rewrite base in the .htaccess file in the /var/www/html/pwire/ directory - see below. Afterwards,  I restarted Apache and cleared site data from the browser. Didn't make one iota of difference!

Mats - my unzipped file is in my (pi) home directory, so I cannot imagine it would make any difference. I only have the 'pwire' directory in the /var/www/html/ directory. A good thought, though!

pwire#4.jpg

Link to comment
Share on other sites

Looks like you uncommented all RewriteBase lines. AFAIK you can only have one. Probably only the last one will have any effect, but you need the one in the middle. Try putting the #s back in the first and third RewriteBase. If it still doesn’t work, maybe paste your entire .htaccess here?

  • Like 3
Link to comment
Share on other sites

Can you please post your Apache2 host/vhost configuration file.

Especially the <Directory ...> part could be interesting - as this is crucial in most cases.

My configuration looks like this:

<VirtualHost *:80>
    ServerName pw.test
    ServerAlias www.pw.test pw.test
    DocumentRoot /home/YOURUSERNAME/www/pw.test

    <Directory /home/YOURUSERNAME/www/pw.test>
	AllowOverride all
	allow from all
	Options None
	Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/pw.test-error.log
    CustomLog ${APACHE_LOG_DIR}/pw.test-access.log combined
</VirtualHost>

 

  • Like 2
Link to comment
Share on other sites

OK, and thanks to everyone for taking the time to assist me. It is really appreciated! A couple of things. BillH - thanks for the explanation of putting random text in the .htaccess file. That makes sense when explained. So I tried random text in the .htaccess file that is in the /var/www/html/pwire/ directory. Restarted Apache; cleared the cache and tried loading. Nope - loaded the page a treat! So then I tried the other .htaccess file that is in /var/www/html/pwire/site/ directory (and recall that pwire is the directory I set up for PW). Same thing. So does this indicate that neither are being 'read'? And if so - why? And which is the 'important' one? Or are they both important?

Next, I took note of Jan Romero's comment and commented out the first and third RewriteBase lines. Doesn't make a scrap of difference!! But thanks for the comment, Jan.

 

And now, wbmnfktr who kindly requested I post my host/vhost configuration file. Well, I'd absolutely love to - but I haven't got one!! I'm guessing it would be somewhere in the /etc/apache2/ directory? I've got 6 sub directories - conf-enabled and -available; mods-enabled and -available and sites-enabled and -available - and three files: apache2.conf, envvars and magic. And try as I may, I cannot find a hosts or vhosts configuration files. Should there be - and if the answer is yes, then shouldn't PW have set them up them during installation? There were no 'errors' thrown during installation that they were missing or that the directory couldn't be written or something like that? Is this a failure on the part of the installation process? Ahhh! I've just found something!! In sites-enabled, there is a configuration file 000-default.conf and it contains the following:

<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

Could this be what we are looking for? Then why the name 000-default.conf? I suppose I could say that the plot thickens!! ?

Thanks again for all the help!

  • Like 1
Link to comment
Share on other sites

Your default apache config file (000-default.conf) should look similar to this...

<VirtualHost *:80>
	#ServerName www.example.com

	ServerAdmin webmaster@localhost
	DocumentRoot /var/www

	<Directory /var/www/>
		Options -Indexes +FollowSymLinks -MultiViews
		AllowOverride All
		Require all granted
	</Directory>
	
	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

The file you posted is missing elements and has elements assigned incorrectly.

The DocumentRoot value should be the location where PW was installed (/var/www/html/pwire). Note there is no slash at the end.
Your file is missing the <Directory> element. This value should be the location where PW was installed -- Including the trailing slash.

Read through this... apache docs

 

  • Like 2
Link to comment
Share on other sites

3 hours ago, mikeindee said:

BillH - thanks for the explanation of putting random text in the .htaccess file. That makes sense when explained. So I tried random text in the .htaccess file that is in the /var/www/html/pwire/ directory. Restarted Apache; cleared the cache and tried loading. Nope - loaded the page a treat! So then I tried the other .htaccess file that is in /var/www/html/pwire/site/ directory (and recall that pwire is the directory I set up for PW). Same thing. So does this indicate that neither are being 'read'? And if so - why? And which is the 'important' one? Or are they both important?

The main PW .htaccess file is the one in your /pwire/ directory.

The .htaccess file in /pwire/site/ is, as I understand it, just there to protect certain files if the main .htaccess is missing – and though I haven't tried, I would guess the PW installation would work without it.

  • Like 1
Link to comment
Share on other sites

Very many thanks BillH. That's exactly the sort of accurate, succinct and relevant information I think I - and maybe others? - need.

Pwired asked me what OS my Pi is running. Here's the result of running the command: cat/etc/os-release:

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian

I believe that tells you all you need to know? And yes, I built this on a USB SATA drive myself - well, from an image I downloaded and then installed via a SD card and then used the SD copy program to create the two partitions on the ssd. (The Pi is in an Argon case with an included 500GB SATA ssd). Hope that helps? Oh, and yes, I know that Bullseye has been released, but for other reasons (that aren't relevant to this issue), I wanted to use Buster.

Rick - thanks so much for the very useful information you've added. I'll have a look at the 000-default.conf configuration file in a while, and reply on my findings. However, as I did nothing with apache - except install it - isn't there an issue here that the PW install doesn't indicate that there appears to be a problem? Shouldn't the PW installer be at least warning me things might not be what they seem?

 

Link to comment
Share on other sites

Rick - I admit to not having read through the very useful Apache documentation yet. I will - it's late here so tomorrow is another day!! However, I did add the elements in the 000-default.conf in the 'sites-enabled' directory file you suggested. BTW, if it was faulty - well, as I said before, I didn't create it (directly), so where have the errors been introduced from? Here's how it now looks (with a few comments removed etc):

<VirtualHost *:80>
   
    #ServerName RPi4

    ServerAdmin xxxxxxx
    DocumentRoot /var/www/html/pwire

    <Directory /var/www/html/pwire/>
        Options -Indexes +FollowSymLinks -MultiViews
        AllowOverride All
        Require all granted
    </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

I've restarted Apache and now if I click on any 'link' (admin login; site map etc), I get:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at xxxxxx to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.


Apache/2.4.38 (Raspbian) Server at 192.168.100.185 Port 80
Not good!! So - where to from here (after I've read and absorbed the Apache docs!) One thing - the home page loaded with just the IP address of the server ie without the /pwire on the end as before. I suppose that's something!! Many thanks again!
Link to comment
Share on other sites

42 minutes ago, rick said:

Now that you have the conf file setup, you need to ensure your .htaccess file is correct.

Remove the gibberish you entered when testing whether apache was reading the .htaccess file as @BillH recommended.

Only enable the RewriteBase for your subdirectory as @Jan Romero mentioned.

if the DocumentRoot is now set to /var/www/html/pwire, there's no need to set the RewriteBase to the subdirectory anymore. Either leave them all commented, or uncomment only the first one: "RewriteBase /"

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...