Cannot start solr on Drupal based site - php

I am trying to get a php / Drupal based website. The site also uses solr, something which I've never used before. I inherited this site and the documentation I was left says that I may need to restart solr which can be done by running:
sudo /etc/init.d/tomcat6 restart
I can see from my Drupal admin that solr isn't running so I tried running it. I unexpectedly got a message saying sudo: tomcat6: command not found. However when I list the directory tomcat6 is clearly there.
These are the permissions:
-rwxr-xr-x 1 root root 7929 Mar 16 2012 tomcat6
Does anyone know what the problem with this is and how I can resolve it?
This apparently was always working and I haven't installed anything since I started with this linux machine (VM).

You should run it this way ./tomcat6 start, if you want to run it directly using tomcat6 start you should add the script's directory path to your PATH environment variable.

Related

.htaccess file is not read in linux

I have a .htaccess file in a php project, I have the apache2 server downloaded and running, but it ignores my project's .htaccess.
When I test the project on Windows or put it on my hosting it works normally.
I already tried to edit the apache2.conf file, among several other methods that I found to solve, and nothing worked, the project worked correctly on the computer of my friends who have linux.
I start the project with the command php -S localhost: 1990 inside the folder that has my files, I tried other ways and nothing worked.
Can someone help me? I've been looking for a long time and nothing has resolved.
I apologize for my English, I'm Brazilian and I still can't speak English very well.
I start the project with the command php -S localhost: 1990
This uses the webserver built-in to PHP, not Apache. Consequently, this does not use a .htaccess file (or apache2.conf).
You need to call your PHP files through Apache - which you say is already "running". (?)
(Aside: There should be no space between localhost: and 1990.)
Reference:
https://www.php.net/manual/en/features.commandline.webserver.php

Magento Cronjob cache configuration

Anyone has experienced change a configuration from magento admin,
clear all cache(including remove the cache folder),
but still load old configuration value from cronjob (if using browser or CURL call, it load the correct configuration)
note:
im using nginx + ubuntu + phpfpm in AWS Ec2, mysql is RDS
im using cron.sh as magento cron
im using magneto custom module with cronjob load old configuration (even core magento configuration value)
Not sure cronjob itself will be cache or not, restart cronjob may help (not yet test), but still dont know the root reason.
Any idea?
---- just test -----
restart cron service not work
restart nginx service not work
restart php-fpm not work
reboot machine work
You can try to use this method. It should works for your configuration.
http://www.emiprotechnologies.com/blog/magento-technical-notes-60/post/automatically-refresh-cache-using-cron-in-magento-307
finally found that, since cron job using ubuntu, then the magento logic will be:
if the var folder (owner is www-data) is not writable by current user (ubuntu)
then write it to /tmp/magento/var/ -- Mage_Core_Model_Config_Options
thus, all old cache store in /tmp/magento/var/, even i clear the cache from magento backend, it will not clear this 'tmp/magento/var'
above issue can be resolve by update var/ to 777, or manually delete the tmp/magento/var/cache in stupid way
however, if using 777 way, another problem occur:
if the cron user create a log file that will share with www-data, the file will be not writable by www-data (644 by default)
another solution is to change the cron user as www-data
However
magento is quite special, the cron.sh will call cron.php and cron.php then call to cron.sh again with bin/sh
thus www-data has no access right to bin/sh, then i cant use it to run cron

PhP Cake app in Apache2 in Ubunutu not working but working find in window's wamp

I have a web application that is writen in php using cake framework. In windows environment i use wamp and it works find if i enbale apache read_write. Then I shift to use Linux environment Ubuntu 15. I have installed apache2 already and php too. it is all work. But when I put my app in /var/www in ubuntu and open the web page it said that the require_once function cannot file the location of the file.
I already change the owner of the www/* to www-data already, but it is still not work. mod_readwrite of apache is also enabled. So I want to know how could I enable read_write in Lamp like in wamp that I did on window? I met the same error in window if I don't enable it. So think it is the problem. Can anyone help me to solve this problem?
One thing you will want to check for is that you're using the proper directory separator in any paths you're using for your require statements (this can be done by using the DIRECTORY_SEPARATOR constant in place of hard coded slashes in your paths)
Another thing you will want to do is look at the apache configuration for each environment and ensure that they are the same. In particular check to ensure that your virtual hosts are defined correctly.

Apache + PHP: Not finding oci.dll after moving from XP to Win 7

my PC was upgraded to Win 7. This meant i now need to setup my Dev environment again. I use XAMPP. I was able to just copy & paste XAMPP folder and then run setup_xampp.bat to correctly set absolute file path in ini and config files.
The issue I now face is that I need connection to oracle and I get several errors. But basically php does not "find" oci.dll. I have added the instant_client directory containing oci.dll to PATH environment variable and restarted (restart is required for apache /services to see this change). However I still get the same error.
I then copied oci.dll into php folder and then php.exe -m -> no error. So it is clear that somehow apache and php do not look in PATH variable to find oci.dll. I'm lost as this worked fine in Win XP. Any ideas how I can solve?
OMG. The new Win 7 install (this is made by my companies IT support) has per default an oracle 8 client installed which is also in the PATH. Hence the solution is to just remove the entry for this old oracle client so that Apache / php uses the new one.

Why are my file permissions on Apache being reset?

We recently switched from using PCs at work to Macs, so I'm new to the *nix way of doing things. I have the default Apache running that shipped with 10.5, but I've noticed that when I drag files from a Windows server to my machine, the permissions are changed. Specifically, I'm writing data to an XML file, and occasionally after swapping some files back and forth, it stops working.
Can someone help me understand why this is happening and how I can either force Windows to respect the original file permissions (they were set on my machine when I created the file) or apply a less secure set of default permissions when the files are moved from Windows to Mac?
A couple facts to be aware of:
I'm using the Cornerstone Subversion client.
I can use Terminal if you spell it out for me.
Ultimately I'm uploading these files via Transmit to a Linux server in another location.
I'm already familiar with using Get Info to change the file permissions, but maybe I'm doing something wrong.
I'm logged in as root. (I know, bad bad bad.)
I should also mention I know this is a simple question that should have a simple answer, but I've googled up and down without finding it. I need your help.
Thanks.
It would be incredibly helpful if you could drop to the Terminal, use cd to navigate to the folder with the files that don't work because of permissions and then type: ls -l (those are both lowercase Ls back there).
If you start from your home folder, it'll look something like this:
macbookpro:~ artlogic$ cd Sites
macbookpro:Sites artlogic$ ls -l
total 8
drwxr-xr-x 6 artlogic staff 204 Mar 11 2008 images
-rw-r--r-- 1 artlogic staff 2628 Mar 11 2008 index.html
macbookpro:Sites artlogic$
Please paste the output into this thread. Knowing what Apache is changing the permissions to would help.
On a side note, Apache generally runs under a different user and permission level than the logged in user and so if it's somehow creating or overwriting files it may be changing the permissions that way.

Categories