Hey,

Doing an install of Drupal 8.4.3 - thought it went fine. But it didn't. (This is my 2nd Drupal site - my first install)

1 - Installed via usual steps through CPANEL - not Drush or Composer.
2 - Built DB
3 - Uploaded and extracted site
4 - Went through install screens.

Front page came up. Awesome - ready top roll...  And nope.

5 - Can't navigate admin screens.
6 - Can't add content.
7 - Error: Not Found
The requested URL /liveSite/newSite/node/add was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

[The "LiveSite" is where the home directory is set to. So the path, for the drupal install is: public_html/liveSite/newSite]

8 - My settings.php looks like this:

$databases['default']['default'] = array (
  'database' => 'DB is here', (actual value removed)
  'username' => 'db UN is here',(actual value removed)
  'password' => 'DB PW is here',(actual value removed)
  'prefix' => '',
  'host' => 'localhost',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',

9 - When I compare to a Drupal site (On SAME server but different account - I have a linux vps). The only thing that seems to be missing in the DB is the PREFIX (broken site example-> block_content_revision vs. live site example ->X1W2_block_content_revision)

10 - I am also missing a Libraries folder but I do not know if that gets "made" after install.

11 - Lastly - When I extract - it does NOT seem to be generating the following files:

csslintrc
editorconfig
eslintignore
eslintrcjson
gitattributes

Any help is appreciated. Thanks!

Comments

mmjvb’s picture

Where does that reside?

What is the DocumentRoot and RewriteBase setting?

What did you enter in your browser? Did you try to login?

CB1_Dru1’s picture

To reach the new drupal install - I HAVE to go here:

http://mydomain.com/CurrentLiveWebsite/newDrupalSite/

The server's home directory is set to the "CurrentLiveWebsite". (is that what you mean by document root?)

I can't reach any page unless I do. When I do that I come to the HOME page and, for whatever reason, it's already logged into admin. So I have the admin tools menu at the top.

However - I can't go anywhere other than that single page. all other attempts throw the warning.

The Drupal install for whatever reason, did not generate an htacess - or I'm not seeing it.

Any other questions - let me know. (I'm not entirely sure I answered the ones you were looking for). Where do I find the rewriteBase setting?

CB1_Dru1’s picture

Okay - found out how to SHOW hidden files. (rookie)

RewriteBase is commented out.

  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /
mmjvb’s picture

In your case it should read : /CurrentLiveWebsite/newDrupalSite

Your DocumentRoot is whatever is in front of /CurrentLiveWebsite/newDrupalSite.
Suggest you introduce a subdomain with a DocumentRoot of <current>/CurrentLiveWebsite/newDrupalSite. If you do you can reach your second site with http://newDrupalSite.mysite.com

If your first site is in CurrentLiveWebsite then advice to move newDrupalSite out of it at the same level as CurrentLiveWebsite. Suggest to map mydomain.com to CurrentLiveWebsite and newDrupalSite.mydomain.com to newDrupalSite. When you do there is no need the touch RewriteBase.

Not sure but your initial report suggests your BaseUrl is not set properly, resulting in the not found error. When the above recommendations don't work, check the BaseUrl.

CB1_Dru1’s picture

I've tried this with no luck. I have an htaccess file in public_html that directs traffic to public_html/CurrentLiveWebsite.

So the htaccess redirect is not working when I try to map a subdomain to public_html/newDrupalSite (now that Current and New reside on the same level.)

This doesn't seem that hard, but it's giving me fits.

mmjvb’s picture

...properly!

With a domain pointing DocumentRoot to CurrentLiveWebsite and another domain pointing DocumentRoot to newDrupalSite everything works as expected! That means there is no need to have an .htaccess in public_html unless your provider requires it to function. It shouldn't contain anything related to redirection! In both Drupal installation you can have the Drupal standard .htaccess.

Configuring the domains setting the DocumentRoot correctly is making this working as expected a piece of cake. Make sure you restarted the webserver to activate configuration changes.

CB1_Dru1’s picture

Okay - work with me...

1 - I need to get rid of the htaccess in public_html
2 - I need my hosting company to point the document root to public_html/currentLiveWebsite (this is not a Drupal site BTW)
3 - I can then create a drupal site at public_html/newDrupalSite

This will give me a public_html containing TWO folders (current and new website)

THEN - I need to create a subDomain that points to /newDrupalSite

Am I missing anything? Or am I missing the boat altogether?

New Information-----

I apologize - earlier posts state the document root is set to /currentLiveSite. THAT IS WRONG. I WAS incorrect. The Document root is probably public_html or else the htaccess redirecting the domain to /currentLiveSite would not be there or be needed.

With that being said - I'm still looking for confirmation that the above 3 steps would/should work before I direct hosting company to redirect document root.

mmjvb’s picture

obviously there are many ways to do it.

Q1 As mentioned, only have a .htaccess in public_html when your provider requires it to function. Your current use is to redirect to currentLiveWebsite, advise against that. That should be done using DocumentRoot for your domain. Normally done via the cpanel of the provider. When that is the only thing in .htaccess, you need to get rid of it.

Q2 Each domain is pointing to a particular DocumentRoot. You should be able to set it using the cpanel of your provider. When not, you should request that from your provider. Suggest to request both at the same time, the change for currentLiveWebsite and subdomain newDrupalSite.

Q3 The newDrupalSite should work without needing changes to its .htaccess using the subDomain. It is no longer available from the Domain due to setting DocumentRoot to currentLiveWebsite. The nature of the sites are irrelevant, they can be anything you want. Expanding means adding a subDomain pointing to another folder in public_html.

Expect the provider to confirm this working when requested to make these changes.

CB1_Dru1’s picture

Thanks MMJVB. This is the clarity I needed. Appreciate it and will follow-up with progress. I do believe the host has to make the changes as I see no ability within my current cpanel configuration.

CB1_Dru1’s picture

@mmjvb - you state above " Each domain is pointing to a particular DocumentRoot. " -- how do I point the domain to my live site folder to get rid of the htaccess in public_html? I'm stuck on this point. And it seems I'm talking to a junior support person at my hosting company and not getting much help.

By the same token - I'm not well versed on this stuff either (but I don't work in server support!).

mmjvb’s picture

... is normally done with the cpanel of your provider. Both for your primary domain and for any subdomains. When your provider doesn't give you a cpanel with that capability you need to file a service request with them. Simple request: Set DocumenRoot:<whatever> for Domain:<whatever>. Their receptionist probably won't understand, it needs to passed on to a technician. A technician should know what to do with it.

See Apache <VirtualHost> DocumentRoot. What to do where depends on their implementation of Apache.

CB1_Dru1’s picture

Thanks - beginning to get it now.

Further question: I set up a subdomain, and the hosting company said a CNAME record needs to be set up where we have DNS (which is not at the hosting company).

That was for my subdomain for the DEV site. (and we are in process of setting that up now)

Does that ALSO need to happen for the LIVE site? Meaning does a cname for the live site need to be set up to point to it's own folder (which currently uses the htaccess sitting in the root directory public_html)

Again, bear with me. Not well versed in DNS, directory routing issues.

Thanks!

tk421jag’s picture

In the past, I've used an htaccess within my root folder to route my main domain to another folder. Basically just this in your htaccess:

RewriteEngine on
RewriteRule ^(.*+)$ yoursitefolder/$1 [L,QSA]

mmjvb’s picture

Not appropriate for multiple sites. The htaccess in public_html (root folder) should only contain statements for all sites.

Preferably it wouldn't even have an htaccess.

tk421jag’s picture

I'm not sure what you mean.

I have shared hosting and my main domain points to public_html.

I host 20+ sites on that same server.

The site with my main domain is pointed to a subfolder of public_html using the htaccess file that I posted above in the root folder (public_html).

After that, all of my "add on" or subdomains are routed automatically using their cpanel tool. (I know....I know......I really should get off panel and shared hosting). 

This is how I got around hosting multiple sites on shared hosting and pointing my main domain to a subfolder.

mmjvb’s picture

That shouldn't work according to the documentation. The htaccess in public_html also affects those in subfolders of public_html. That applies to all htaccess files in the folders up to the DocumentRoot. Normally there are no htaccess files in folders above public_html, but if there were they would be processed as well.

The content you mentioned should interfere with proper working of the subdomains. Don't know why it doesn't in your case.

tk421jag’s picture

It's definitely possible that it shouldnt work that way. But I can tell you that I've used this method on at least 5 other shared hosting services with multiple sites hosted on them. The registered domain for the account is always pointed to the root, and so this lets it route to a sub folder.

gaur23jnv’s picture

I got it right way .

Lohri status