Drupal 7 Login can't view admin bar, Fresh Install via Drush on CentOS 6.3 - apache

I've spent quite a few hours trying to figure out what the problem is. The issue is:
Login works but the page doesn't change once I log in as admin. I know that the login works because wrong credentials generate an error. I do not even see the administrative toolbar. No other pages exist on the page, but if I am to, say, input ?q=admin, on user/1, it will go 'Access Denied'
What I've done:
cleared cache and cookies many times
have checked that mod_rewrite works
the cookie path on the drupal settings.php is / and not \
.htaccess is on the drupal root directory, exactly as provided by
drupal.org
in httpd.conf, I have written a new directory and AllowOverride=All
(*note: the parent directory has AllowOverride=None)
Clean URL's are enabled via drush vset
What I suspect the problem is, but don't know how to solve it:
Proxy?
Some permissions that need to be configured on some files/directories
What I have:
CentOS 6.3
Apache 2.2.15
Drush 5.9
Drupal 7.22
Thank you in advance

I can't imagine that this would be a permissions issue, but if it were, you could just start by doing (and btw, I would NEVER recommend doing this on a production server):
cd /<path_in_which_drupal_root_sits>
chown -R apache:apache <drupal_root>
chmod -R 777 <drupal_root>
You might need to sudo to do these, and you will definitely want to bring the chmod permission back down to 775, 755 or 644 as is appropriate to the directory/sub-directory once you're done testing.
This will probably not solve your issue outright, but it will at least help you to eliminate permissions as an issue.
To test proxy issues, you might try installing lynx (command-line http client), and try accessing your site through it using localhost. You should be able to login, and if you get a different result that way than via remote access, you might indeed have some weird proxy or other network issue that's interfering.
Lastly, and this might actually be the most helpful bit here, you ought to inspect your headers before, during and after the login process. You can do this using FireBug or Developer Tools or the like. And, of course, check your Apache access and error logs for anything unexpected or out of the ordinary.
Most likely, though, you just need to reinstall and try it again.

Turns out that it was a SELinux problem. I found out that if I logout via the logout URL and then use https on my website, I can login and use it properly. I needed to reinstall the certificates and setup the security... Thanks for everyone's help.

Related

Drupal 8 cannot login after domain name change?

I have done simple Drupal 8 installation and while developing was accessing it via it's IP address, now when trying to log in as admin on the actual domain, every time after processing correct credentials it throws "Access Denied".
Google reveals this should be cookie_domain related issue. Tried changing the setting in services.yml to no avail, drush cr not helping. Either the issue is unrelated or the YML settings are not being picked up. Tried VM reboot since to no avail.
Have u checked the clean URL's enable on your site?
Try login your website from the URL: http://www.example.com/?q=user/login
Also I have noticed you have Drush installed. So use the drush for one time login link for user.
eg: drush uli
Hope this helps you.

Put right permission - owner/group to public_html folder

I'm new to WHM, cPanel, and CentOS.
I install WHM then create an account for domain app.example.com and user peter
I point the domain name to right IP address but when I run my website app.example.com I got HTTP ERROR 500
Via SSH I log into the server and I find my previous uploaded code into
/home/peter/public_html
Then I run command sudo chown -R peter:peter /home/peter/public_html
and when I look at folders permission and owner they looks like:
I think my HTTP ERROR 500 is about user permission.
Can please help me to add right privileges to a user or what I need to do to my public_html folder be visible to the world (at browser).
What I need to do?
The best thing to know if it's a permissions problem, a bug in the programming of the web application or to see what really happens, is that you look at the log file of the web server (apache, nginx, the one you use). The log will give you more clues. Could you copy the log output when the error occurs?
It seems some required extensions were not activate or had been removed from your VPS. You should check and install/activate them. Then you can test your website again.
P.S: Sorry for my bad english

Apache2 blocking access to specific directory in root of server

I'm working on setting up a website and at first I thought the website was broken but then I look and I'm getting 403d on everything under /javascript/
I've double checked the filesystem permissions. I can rename the javascript folder to js and access the files just fine from a browser. I've tried finding all the locations where the site tries to access /javascript/ and change it to just /js/ but there are some other scripts running that are generating some script tags and it's not proving easy to find them all.
My question is, is there an easy(ish) way to find where apache may be hanging me up? It's a basic apache2 install on ubuntu 14.04 running in a digital ocean droplet.
Now I feel silly.
Just ran grep -r "javascript" . just the same as I was using it to look for references in the website and I see there's a default aliasing of /javascript in the apache2 conf of javascript-common (though it didn't seem to show up in conf-enabled). I ran sudo a2disconf javascript-common and I had access back to the folder.

"This webpage is not available" error after altering /www directory

I built the login functionality for a website on an AWS ec2 ubuntu with LAMP setup and it was working fine. The PHP files for this were located in /var/www/html. Then, to also allow login from an android device, I added and began working on the directory android_login_api in the /www folder. After adding several files and directories to this I noticed the website was no longer working and displayed "This webpage is not available" when I attempted to reach it. Despite completely removing android_login_api and attempting to revert the directory /www to just the way it was when it worked, this error remains.
I have spent a few days searching for a solution, but most answers pertain to the setup of apache which was already working fine for me. I tried restarting apache but neither index.php nor any other files I specify can be reached. I have also spent a lot of time trying to edit apache .conf files but with no luck.
Any ideas about what may have happened or if there is a specific path I need but may have accidentally altered would be greatly appreciated.
Most of access problems are caused by incorrect configuration of Virtual Hosts which seems like the problem here.
As you mentioned, the readable directory was /var/www/html and then you tried to access /var/www/android_login_api, which is not accessible by default and is specified in your virtual host file for the website. Location: /etc/apache2/sites-available
If you have done it different to this article, it will be difficult for anyone to help you. Don't create hosts in apache.conf. Read it before reading my answer further.
When you make changes to the virtual host, don't forget to use sudo a2ensite yoursite.com.conf as well as restarting apache service with sudo service apache2 restart after enabling the site.
The last thing that you should know about setting up websites is www directory owner. When you done making changes to files via FTP or SSH, run sudo chown www-data:www-data /var/www -R. www-data is the username like root used by Apache to allow external access. Otherwise the fiels will be accessible only with 0755 permissions by any other user and not 0644.
This is just a bunch of things essential to make changes and work with HTTP servers. Though my answer is not clear and I'm unable to point out your issue, I believe I've given you additional knowlege/consideration points to troubleshoot your issue. Drop a comment for more specifics.

Wordpress: Installing Plugin error -> Could not create directory

this has been asked again and again, but none of the solutions I found actually works for me. I'm testing a new server (Ubuntu server 14.04) and have gone through the whole installation process of the various required software. So far I can access my internal web page via
http://myInternalIP/wordpress/
I added there a dummy post and it looks ok.
Now I wanted to add a plug-in, but I'm having major trouble with that.
So here is what I have done.
I added a new user called ftps that has it's home dir in
/usr/share/wordpress/
and this is part of
~$ groups ftps
ftps : ftps www-data
When I try to add a plug-in, all goes well until I get the following message:
Downloading install package from https://downloads.wordpress.org/plugin/wordpress-importer.0.6.1.zip…
Unpacking the package…
Could not create directory.
Return to Importers
So the general answer I found in many posts, is that this is a permission issue. Fine. Well I'm fighting with the permission issues since xx hours. So here is a brief summary of what I've done:
I've tried changing ownerships and groups around (www-data, my user name, ftps). It did not work.
I've changed permissions to 777 to all the wordpress directory in /usr/share/wordpress.
I've tried the following commands:
sudo -u helder touch /usr/share/wordpress/wp-content/plugins/test.txt
sudo -u ftps touch /usr/share/wordpress/wp-content/plugins/test.txt
sudo -u www-data touch /usr/share/wordpress/wp-content/plugins/test.txt
All of these commands generated a file succesfully in the specific directory.
My feeling is that permissions are not the issue, but I might be wrong... what should I look out for?
Thanks
I had to enable write_enable=YES in the file vsftpd.conf.
If you are using vsftpd as your FTP server and have enabled passive connections, you need to add pasv_promiscuous=YES to /etc/vsftpd/vsftpd.conf.