Post request not working Drupal and Ubuntu 14.04 - php

In my ubuntu 14.04 OS machine for drupal 7 login not working, may be it is not only login but all post request not working here. For the same filesystem and codebase it works fine in windows 7 machine.
Here is my apache server configuration:
<VirtualHost *:80>
ServerName somedomain.local
DocumentRoot "/home/mycompany/Development/Projects/Drupal/cbb"
<Directory "/home/mycompany/Development/Projects/Drupal/cbb/">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
for above configuration when i try to submit data for login it showing..
"NetworkError: 404 Not Found - http://somedomain.local/user".
#UPDATE:
I just find out that login not working only from www.domainname.local/user path but if this login form in homepage sidebar it works fine, for all of drupal sire in ubuntu machine. With this no error message also not display.
I am in trouble for two of my drupal site in Ubuntu machine. Any help will be appreciated.

Check if .htaccess file present in drupal root directory.
Check if you've added your domain to /etc/hosts file
127.0.0.1 domain.name
Domains with 'www' and without it are totally different. Add both to /etc/hosts and to apache's config file to avoid problems.
Clear cache to avoid previous domain name which could be stored in cache.
drush cc all
If you've just added new site to apache's configuration be sure to run:
sudo service apache2 graceful

Your Apache vhost file looks like it has the key components set and I'm assuming that the .htaccess file exists in your document root and hasn't been modified from the Drupal default.
When you click on the login link in the sidebar, does it take you to http://somedomain.local?q=user/login ?
Your #update suggests that even though your Apache environment may be set up for "clean URLs", the feature is not enabled in Drupal at Administer > Configuration > Search and metadata > Clean URLs.
If modifying this compromises your access to Drupal, you can apply/disable this change via Drush (drush vset clean_url 0 --yes) or directly through MySQL (UPDATE variable SET value = 's:1:"0";' WHERE name = 'clean_url';) as per https://www.drupal.org/node/5590.
Also worth mentioning, seeing it on this related question (Very strange Drupal 7 404 behaviour): make sure that Apache modules mod_rewrite and mod_headers are enabled:
sudo a2enmod rewrite
sudo service apache2 restart

Related

localhost loading wrong css files

I have a custom website in Magento 1.9 running on my localhost, its Ubuntu 18. LTS , running on a php 5.6 and apache, everything works fine, but not the css
This is the url is loading:
http://local.mysite.com/var/www/html/mysite/skin/frontend/base/default/css/files.css
So as you can see it loads /var/www/html witch is wrong, this is my virtual hosts inside apache2 folder sites-available:
local.mysite.com.conf
<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin webmaster#domain1.com
ServerName local.mysite.com
ServerAlias local.mysite.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.php
DocumentRoot /var/www/html/mysite
# Custom log file locations
LogLevel warn
ErrorLog /var/log/apache2/error-mysite.com.log
CustomLog /var/log/apache2/access-mysite.com.log combined
</VirtualHost>
Just for the record i have enabled mod rewrite
sudo a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
systemctl restart apache2
Guys you can try this to solve the problem. I also faced the same problem it helped me
i redid all the steps that i have done before, like getting all the files from svn, re-importing the database, and changing the web/unsecure/base_url & web/secure/base_url, configuring apache virtual hosts etc..
but i think what solved the problem was changing the ownership of media and var directories to www-data instead of user and giving those folders full permissions.
I have done this step because in the main server, the those directories were owned by www-data user..
Also, i observed that the css was loading from zz.com/media/css folder, which was automatically created once the media directory was setup properly, which did not happen earlier, the directory has css files like 0a039da6028e6d636132ecd5e235f417.css etc..
the request url was something like this (from net window in firebug)...
http://zz.com/media/css/0a039da6028e6d636132ecd5e235f417.css
and not like the one i mentioned how it should be above (http://zz.com/skin/frontend/default/jm_wall/css/layout.css), nor like how the request was sent (http://zz.com/var/www/zz.com/skin/frontend/default/jm_wall/css/layout.css)
Hope this helps someone else...

No input file Specified. Laravel 5.5 CentOs

Hie, I am trying to host a Laravel project on a VPS server with Cpanel. I am getting the No input file Specified error when I access the site.
Things I did so far>
Got Managed VPS hosting from inmotionhosting.
Got into root and downloaded the laravel project on var/www/html.
Got a domain name point at the server's Ip address using A.
Changed the virtual host file servername and alias to the domain name keeping the ip address on the top as shown below:
<VirtualHost ipaddress:80>
ServerName mydomain.com
ServerAlias www.domain.com
DocumentRoot var/www/html/laravel/public
</virtualhost>
Now when I access the domain it returns No input file Specified error. I am not sure how to change the .htaccess to get this working, I believe it is something to do with the server .htaccess. I did fiddle around for quite a bit but a no vain so I had to turn to stackoverflow.
Adittionaly I changed my html folder permission and ownership to apache, tested with 755 777, tested with different user name no luck.
Not using vagrant or homestead or forge , Any suggestions
I had a similar issue. While I also edited the Apache configuration and it didn't work, since for me it was PHP-FPM.
For some reason the document root was not changed in /opt/cpanel/ea-php72/root/etc/php-fpm.d/{my-domain-name-here}.conf.
Correcting the document root here is what did the trick. So if you have a PHP-FPM configuration.
Check the document root specified there as well and then restart the FPM service.
You might run this command to restart FPM service:
/scripts/restartsrv_apache_php_fpm
Also don't forget to restart php-fpm service after changing document root,.
In my using in my case was:
systemctl restart ea-php72-php-fpm.service

localhost/~username is not working, gives 404 Not Found error

I am fairly new to server-side web development and am trying to get a local server up and running. I'm using an apache 2 server on my mac, but can't for the life of me get localhost to give me anything but 404 Not Found error. I'm putting localhost/~ and my username in the search bar and still nothing. I've been following a lynda.com tutorial to configure my personal site folder and haven't had any luck.
I'm trying to configure a personal site folder, or at least that is the terminology used in the tutorial. I created a "Sites" folder in my home directory. Then, I put an "index.html" file in the "Sites" folder to test.
After that, I configured a "httpd.conf" file through my terminal by entering "sudo nano/etc/apache2/httpd.conf". He had me un-comment the following lines:
LoadModule userdir_module libexec/apache2/mod_userdir.so
Include /private/etc/apache2/extra/httpd-userdir.conf
After doing this, I exited the file and saved the changes. I then entered into the terminal:
sudo nano /etc/apache2/extra/httpd-userdir.conf
Here I uncommented the following line:
Include /private/etc/apache2/users/*.conf
I then entered into the terminal
cd /etc/apache2/
And then:
cd users
I entered:
sudo nano jacobbryant.conf
In this file, I made sure it only contained:
<Directory "/Users/jacobbryant/Sites/">
Options Indexes MultiViews
AllowOverride None
Require all granted
</Directory>
I then exited this file and restarted the apache server with:
sudo apachectl restart
After this, I went to my browser and typed in "localhost/~jacobbryant" and got a "404 Not Found" error.
I am not sure what #jhilgeman is talking about. Apache has an extension for Per-user web directories that must be setup in order to map ~username to the home directory specified in the configuration. It looks like you have enabled the correct extension but missed the UserDir directive.
For Example: UserDir public_html will serve /home/myuser/public_html at http://your.host.tld/~myuser/
For you example, ditch the <Directory> and use the UserDir directive instead. Please read over https://httpd.apache.org/docs/2.4/howto/public_html.html for setup instructions.

Configuring HHVM 3.7 with Apache 2.4 gives me a 404?

I can't seem to configure HHVM and Apache, it keeps giving me a 404 file not found error. My configuration file for the website is saved as www.example.com.conf, it contains:
<VirtualHost *:80>
ServerName website.com
ServerAdmin mail#website.com
DocumentRoot /var/www/website.com/public_html/
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/website.com.com/public_html/$1
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Note that I've removed my actual website name, but it's for a subdomain so it's this: subdomain.xyz.com. I've tried looking up how to fix this, but whatever I've tried doesn't seem to work; even the GitHub issues people have posted on the official repository don't seem to work. I also haven't changed the default apache configuration, the only thing I have changed is the root directory of my website which does much up to the directory in the configuration file above.
Any ideas? Thanks.
I know it's been two months already, but maybe it helps someone else (I had a similar issue occur many times when configuring HHVM + Apache2).
Try to enable the vhost if you haven't yet done so. Issue sudo a2ensite www.example.com and reload apache afterwards with sudo service apache2 reload.
If the vhost is ok and you have your browser requests visible in the vhost access log, then it means that it's not Apache2 that's the culprit there.
So if you're still with me and the first two steps didn't help, try the following, although in HHVM 3.7 it shoulnd't be the case anymore (but it might, I just follow the try-and-check method when it comes to configuring HHVM, and it usually works). Open /etc/hhvm/server.ini and append the following line to that file:
hhvm.server.fix_path_info = true
After changing the HHVM's configuration, issue sudo service hhvm restart. Then try to refresh your website. It should be all good.
I had similar issues and back then it was the most common fix on all webservers I configured to work with HHVM. But, after the latest updates, I had to comment that line out of my hhvm server.ini in order for my code to work - I read that they have somehow changed the parameters of the server and this parameter does no good anymore, AFAIK.
I have also tried to put that line in /etc/hhvm/php.ini but as far as I remember, it should go to server.ini because it's a server parameter.
So. Try it and let me know if that helped. If not then please issue the following commands on your webserver and paste the output here, so I can see if you have the necessary modules installed
ls /etc/apache2/mods-available | grep -E 'proxy|alias|fcgi|hhvm'
ls /etc/apache2/mods-enabled | grep -E 'proxy|alias|fcgi|hhvm'
Oh, and please include your full HHVM and Apache2 version output:
hhvm --version
apache2 -v

I can't seem to get started with Zend Framework 2 skeleton app

I'm following through the getting started skeleton app tutorial on the Zend homepage:
http://framework.zend.com/manual/2.2/en/user-guide/skeleton-application.html
I've got as far as being able to enter into the browser address bar "zf2-tutorial.localhost/" and my Zend welcome page should appear. It doesn't, the apache web folder (/var/www) directory appears instead. If I enter "http://zf2-tutorial.localhost/1234" to test whether the Zend 404 page appears, it doesn't. The default apache Not Found page appears.
I created my app by running in terminal:
php composer.phar create-project --repository-url="http://packages.zendframework.com" zendframework/skeleton-application:dev-master /var/www/zf2-tutorial
.. this created all the files in the desired folder (/var/www/zf2-tutorial).
I then created the file /etc/apache2/sites-enabled/zf2-tutorial with the following:
<VirtualHost *:80>
ServerName zf2-tutorial.localhost
DocumentRoot /var/www/zf2-tutorial/public
SetEnv APPLICATION_ENV "development"
<Directory /var/www/zf2-tutorial/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I updated my /etc/hosts file with:
127.0.0.1 zf2-tutorial.localhost localhost
I restarted apache
sudo service apache2 restart
.. and by this point I should be able to see the Zend welcome page so I can proceed with the rest of the tutorial but nothing.
By the way, I'm using Ubuntu 12.04, Apache/2.4.9 (Ubuntu) and PHP 5.5.14.
Is there anything obvious that I've missed out? I've got a feeling that it has something to do with the mod_rewrites but I'm a little confused which I should be updated and how. Any help would be much appreciated.
Add the
<VirtualHost *:80>
[... same code ....]
</VirtualHost>
in the /etc/apache2/sites-enabled/000-default file and restart the apache2
Update -
If it still doesn't work then try the below command and check -
sudo a2enmod rewrite
sudo service apache2 restart
This will enable the rewrite module if not already is.
After entering the URL in the browser, if the required page is not displayed then check the apache error log file located at /var/log/apache2/error.log
By this, you could get some idea as where its going wrong.
Your problem was in config file name. In directory sites-enabled files should have .conf in the end of name.
Good: zf2-tutorial.conf
Bad: zf2-tutorial

Categories