Migrating Drupal - drupal

Currently I have a single drupal site installed on apache 2.2 with php 5.3 on RHEL 6. I am moving servers and am trying to migrate the site. I have imported the database and htaccess, but I cannot access any of the pages other than the root of the site.

You may need to disable clean URLs before exporting the database, try to add ?q= before each path.

That happens when:
a) Apache mod_rewrite is not enabled. If you have root access then do sudo a2enmod rewrite
or
b) .htaccess file at the root folder isn't there, so you need to copy it again.

Here's a troubleshoot check list for mod_rewrite issues:
Make sure Apache's rewrite module is enabled: sudo a2enmod rewrite.
Make sure original .htaccess file is there in the root of your Drupal installation.
Make sure that the existing .htaccess file is getting read by Apache. To test it, add a this line in the beginning of the file and you should get a 500 Internal Server Error: ThisIsReallyABadSyntax.
If the .htaccess file is not in effect, make sure that the AllowOverride directive in the main Apache config file (usually /etc/apache2/httpd.conf on debian-based distros) is set to All. It might be set to None by default.
Finally, make sure that the clean URLs feature is enabled in Drupal settings.

With the phpinfo(); compare all the server specs, just to be sure both server are quite the same or similar.

Steps to migrate Drupal correctly:
Go to Configuration
find Clean URLs
Disable tick inside!
Clean cache!
Download your site file
Download your database
Create new database in your new site
Transfer file and database
Log in
10.Do this step to enable Clean URLs:
It's work 100% guaranteed !
Steps:
1. Download - Dev version (7.x-dev)
2. Find file .htaccess
3. just copy it to your server
4. That's it !

Related

Silverstripe install root folder public

I have installed silverstripe 4 into the /var/www/html folder in apache.
However, when I go to the url, I have to use "localhost/public/index.php" in order to obtain the main page. I thought I was to be able to just go to "localhost" to find the defaut page. What am I to do if I want to have a main page without people having to specify "/public/" before it?
Thanks.
Normally, your localhost website can be resolved without adding /public/ if the following 2 things are configured correctly.
Enable Apache mod_rewrite
Having .htaccess rewrite config in /var/www/html
Troubleshooting
Check if you got the right .htaccess in /var/www/html. Basically, this Apache config file will forward all the requests to /public/ folder.
If .htaccess is fine, make sure your mod_rewrite is enabled in your Apache. Check this link.

loading Module mod_rewrite on httpd.conf file causes "Forbidden" error on localhost

Im on a mac running Sierra 10.12.2 and apache 2.4.23
I set up a localhost environment and a virtualhost for the domain cumsa.mx and installed wordpress on it. Without getting too into detail now, some changes were made on Git that modified the wp permalinks, and hence the .htaccess file through wp.
I went to my main httpd.conf file and told it to load the module mod_rewrite as suggested by a colleague since that was necessary to be able to modify the htaccess file. Regardless of that, activating this module results in my local environment for cumsa.mx to become "Forbidden".
Can anyone think of any idea why this wouldbe the case or which permissions I need to modify and how? Thanks!

Wordpress on Nginx server - .htaccess vs. nginx.conf

I have recently changed from Apache to Nginx server and running a Wordpress installation that was migrated onto this new Nginx server.
I only just realised that (the server provider forgot to mention) that the .htaccess file is no longer supported and shouldn't be used with Nginx.
Instead the nginx.conf file should be used. I know I can convert the contents of my current .htaccess file to nginx.conf using one of the convertors, but I don't even have the nginx.conf file.
Can I just create one?? And If I create one, do I place it into the root where currently my .htaccess file is??
Do I then delete the existing .htaccess file?
How should I go about this?
You definitely have nginx.conf - without it, your site wouldn't work. It is in /etc/nginx/ folder, and some additional configs can exist there and in subfolders.
Standard recommendations for WordPress with nginx you can find here in Codex. But if your site works, you have nothing else to do.
Unlike Apache with .htaccess files, nginx does not use any configuration files in WordPress folders. Everything is centralized in /etc/nginx/.
.htaccess files are ignored by nginx and can be deleted or kept in WordPress folders - it doesn't matter.
However, if you have some non-standard tuning in .htaccess files, you should implement relevant directives in nginx conf files. Convertors not very good for it, and produce errors sometimes, unfortunately. You should learn Apache rules used and create similar for nginx by yourself.

Drupal Site Download : Not able to install site as-is

I recently downloaded a fully functional drupal(6) site using FTP. Though I installed the Drupal instance, I got the modules and the themes that were in the sites/all folder, but wasn't able to get the actual site configuration ( Configuration and Settings of those modules )
Any help in this regard would be greatly appreciated.
Assuming this is a follow-on of: Drupal Site install on localhost after downloading source using FTP
If you get the Drupal install screen when accessing a site you've just migrated to your localhost, it's likely because you're trying to access the site locally using a URI that's different than the remote site AND this URL does not fall within the directories that Drupal searches when looking for a settings.php file (see comments starting about line 20 in the default.settings.php file of the sites/default folder).
You have two options:
Option 1: Create a symbolic link on your localhost that points requests to your local URI to the directory hosting the live site. This would look something like this:
ln -s /path/to/webroot/sites/default/ /path/to/webroot/sites/mydevsite.dev
Option 2: Create a sites/sites.php file that maps URI's to the correct folder hosting your settings.php file. For example, you'd add this to sites/sites.php if you left your settings.php file in the sites/default folder:
$sites['mysite.dev'] = 'default';
$sites['www.mysite.dev'] = 'default';
$sites['mysite.com'] = 'default';
$sites['www.mysite.com'] = 'default';
Simply put, this translates into: "Serve sites mysite.dev, www.mysite.dev, mysite.com, and www.mysite.com from the folder located at sites/default."
I usually use the second option. It's more sustainable, OS independent, and can be committed to source control.
Update based first 5 comments:
You need to edit the .htaccess file in your Drupal install. Look for this section:
# 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 /
And do as it says, uncomment out the line and set it to your subdirectory.
Yes the steps are correct. Is it the design that is not coming or is the functionality of views missing? If its only the css that is not coming, then the issue could be that your theme is not getting applied. Check if the theme folder correctly exists, and disable/enable the theme.

WAMP + directory alias + Drupal clean URLs

I have WAMP installed on my pc where I would like to run Drupal 6.
When I'm installing Drupal, I get the option to activate Clean URLs.
First I put my Drupal install in the www folder and I could choose to enable the clean URLs, but for backup reasons I moved it outside the www folder and created an alias the would point to the folder.
When I installed Drupal again, I couldn't choose to enable clean URLs anymore; the option was grayed out.
I would like to know why this happens; it seems some Apache module or PHP extension isn't available outside the www folder.
Just to be sure, I also tried an XAMPP install and created an alias with the some code lines as in the WAMP server but that worked, for some reason. The Apache version in WAMP isn't the same as the XAMPP install but I don't really think that is relevant.
I believe it's an config error in WAMP but I can't find out what.
Clean URLs doesn't work in the directory you copied Drupal because for that directory the directive AllowOverride is not set to All.
Drupal requires that every directives found in .htaccess files are enabled, in order to enable clean URLs; the directive AllowOverride, when set to All, allows to use all the directives that a .htaccess can contain.
The reason that in one case you can select the the option to enable the clean URLs, and in the other case is not selectable, is that Drupal, during its installation verifies the server is set to work with clean URLs, and change the form field to read-only if the server cannot support such feature.
To notice that the .htaccess file provided from Drupal can possibly need to be edited, in order to enable the clean URLs, as reported in the following comments, found inside the .htaccess file.
# 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 /

Resources