I am trying to create react app and i have a nodejs (express) backend
here is a link to the repo
as you can see in the repo the file client is empty
and I can't add (stage) the client file
when I do git add. then git status
I get the following message
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in
submodules)
modified: client (modified content, untracked content)
modified: package.json
no changes added to commit (use "git add" and/or "git commit -a")
I tried git add . , git add client
but nothing works i can't push the client file to github
ls -all returns this :
total 55
drwxr-xr-x 1 user 197121 0 Jun 20 16:38 ./
drwxr-xr-x 1 user 197121 0 Jun 20 15:11 ../
drwxr-xr-x 1 user 197121 0 Jun 21 10:24 .git/
-rw-r--r-- 1 user 197121 15 Jun 20 15:18 .gitignore
drwxr-xr-x 1 user 197121 0 Jun 20 15:57 client/
drwxr-xr-x 1 user 197121 0 Jun 20 15:14 node_modules/
-rw-r--r-- 1 user 197121 362 Jun 20 17:14 package.json
-rw-r--r-- 1 user 197121 14290 Jun 20 15:14 package-lock.json
-rw-r--r-- 1 user 197121 389 Jun 20 15:17 server.js
Try execute
git rm -rf --cached client
and
git add client
in the client directory.
Related
I have written an application in CakePHP 3.2 and recently uploaded to a dedicated server.
But this is giving RuntimeException error as
Cache engine Cake\Cache\Engine\FileEngine is not properly configured.
Warning: file_put_contents(/var/www/html/logs/error.log)
[function.file-put-contents]: failed to open stream: Permission denied in
/var/www/html/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 134
I tried with changing permission of logs and tmp directory to 777 (including sub directories) but this doesn't solve the issue.
output of ls -la
drwxr-xr-x. 13 root root 4096 Oct 22 02:39 .
drwxr-xr-x. 4 root root 43 Oct 12 20:12 ..
drwxr-xr-x. 2 root root 63 Oct 21 15:08 bin
-rw----r--. 1 root root 1499 Oct 21 15:08 composer.json
-rw----r--. 1 root root 48701 Oct 21 15:08 composer.lock
drwxr-xr-x. 3 root root 4096 Oct 21 15:08 config
-rw----r--. 1 root root 329 Oct 21 15:08 .editorconfig
-rw----r--. 1 root root 772 Oct 21 15:08 .gitattributes
-rw----r--. 1 root root 41 Oct 21 15:08 .gitignore
-rw----r--. 1 root root 159 Oct 22 03:02 .htaccess
-rw----r--. 1 root root 648 Oct 21 15:08 index.php
-rw-r--r--. 1 apache apache 20 Oct 13 00:10 info.php
drwxrwxrwx. 2 root root 46 Oct 22 02:30 logs
drwxr-xr-x. 2 root root 10 Oct 21 15:08 mobile_scripts
-rw----r--. 1 root root 1202 Oct 21 15:08 phpunit.xml.dist
drwxr-xr-x. 3 root root 37 Oct 21 15:08 plugins
-rw----r--. 1 root root 1015 Oct 21 15:08 README.md
drwxr-xr-x. 8 root root 4096 Oct 21 15:13 src
drwxr-xr-x. 4 root root 71 Oct 21 15:13 tests
drwxrwxrwx. 6 root root 76 Oct 21 15:13 tmp
-rw----r--. 1 root root 321 Oct 21 15:08 .travis.yml
drwxr-xr-x. 21 root root 4096 Oct 21 15:14 vendor
drwxr-xr-x. 5 root root 4096 Oct 21 15:24 webroot
What could be the cause and how to resolve it ?
I had the same problem.
It can be due to the permission of logs and tmp directories.
But sometimes, if your web server user is different from your command line user, you can have this permission error !
You can run this little command in the project's directory :
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
setfacl -R -m u:${HTTPDUSER}:rwx tmp
setfacl -R -d -m u:${HTTPDUSER}:rwx tmp
setfacl -R -m u:${HTTPDUSER}:rwx logs
setfacl -R -d -m u:${HTTPDUSER}:rwx logs
It will setup permission properly !!
Don't forget to restart apache services :
service apache2 restart
If you want to check this : https://book.cakephp.org/3.0/en/installation.html
I hope it will be helpfull !! :D
I got it working. For someone if get stuck with this error can try this solution.
I am using centOS Server
disabling SELinux worked for me.
I had the same issue and it looks like it had to do with apache not having the right permissions on the project files.
I managed to solve it by recursively setting the owner and the group of the whole project directory to the web server user by:
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
sudo cd "your project directory"
sudo chown $HTTPDUSER:$HTTPDUSER -R .
Hope that helps!
Anuj's answer about disabling SELinux worked for me as well. I was delighted to find this after hours of trying other things. I just wanted to add that I didn't disable it, but rather changed it to 'permissive' from 'enforcing.' I am running CakePHP 2.4.2 on CentOS 7 on an AWS T2 instance.
Good morning,
I have a problem with my Nagios configuration. This is the response of service nagios status :
root#SRV-SUPERVISION-BT:~# service nagios status
● nagios.service - LSB: Starts and stops the Nagios monitoring server
Loaded: loaded (/etc/init.d/nagios)
Active: active (running) since ven. 2016-06-17 09:47:46 CEST; 41min ago
Process: 458 ExecStart=/etc/init.d/nagios start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/nagios.service
├─533 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios...
├─553 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/...
├─555 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/...
├─556 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/...
├─558 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/...
├─559 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/...
├─560 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/...
└─623 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios...
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: nerd: Channel opathchecks r...y
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: nerd: Fully initialized and...!
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Successfully registe...r
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Registry request: na...3
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Registry request: na...8
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Registry request: na...9
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Registry request: na...6
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Registry request: na...0
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Registry request: na...5
juin 17 09:47:48 SRV-SUPERVISION-BT nagios[533]: Successfully launched comma...3
Hint: Some lines were ellipsized, use -l to show in full.
But when I'm going on the web interface, Nagios Core is not running.
The configtest command is also right :
root#SRV-SUPERVISION-BT:~# service nagios configtest
Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
Object precache file created:
/usr/local/nagios/var/objects.precache
Also, this is the right of my /usr/local/nagios/var:
root#SRV-SUPERVISION-BT:/usr/local/nagios/bin# ls /usr/local/nagios/var -l
total 88
drwxrwsr-x 2 nagios nagios 4096 juin 16 23:59 archives
-rw-r--r-- 1 nagios nagios 34 juin 17 11:00 nagios.configtest
-rw-r--r-- 1 nagios nagios 4 juin 17 09:47 nagios.lock
-rw-r--r-- 1 nagios nagios 3007 juin 17 10:47 nagios.log
-rw-r--r-- 1 nagios nagios 12665 juin 17 09:47 objects.cache
-rw-r--r-- 1 nagios nagios 12665 juin 17 11:00 objects.precache
-rw------- 1 nagios nagios 13062 juin 17 10:47 retention.dat
drwxrwsr-x 2 nagios nagcmd 4096 juin 17 09:47 rw
drwxr-sr-x 3 root nagios 4096 juin 3 08:28 spool
-rw-rw-r-- 1 nagios nagios 13485 juin 17 11:26 status.dat
I'm on Debian :
root#SRV-SUPERVISION-BT:~# uname -a
Linux SRV-SUPERVISION-BT 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux
I do not understand the problem. If anyone can help me, thanks in advance.
First you must install fcgiwrap:
Depending on your distribution you should use your package manager.
Then, you should enable cgi module in your Web Server, for examle, in apache:
Finally, restart apache and it´s should be work.
You must install/run fcgiwrap and use it in your web-server apache/nginx/..
I'm trying to setup an old version of Solr for one of our drupal developers. Apparently only versions 1.x or 3.x will work with the current version of drupal.
I'm setting up solr 3.4.2 under tomcat.
I have solr living in /opt:
# ls -ld /opt/solr
lrwxrwxrwx. 1 root root 17 May 6 12:48 /opt/solr -> apache-solr-3.6.2
And I have my cores located here:
# ls -ld /opt/solr/admin/cores
drwxr-xr-x. 3 root root 4096 May 6 14:37 /opt/solr/admin/cores
Just one core so far, until I can get this working.
# ls -l /opt/solr/admin/cores/
total 4
drwxr-xr-x. 5 root root 4096 May 6 14:08 collection1
I have this as my solr.xml file:
<solr persistent="false"
<cores adminPath="/admin/cores" defaultCoreName="collection1">
<core name="collection1" instanceDir="collection1" />
</cores>
</solr>
Which is located in these two places:
# ls -l /opt/solr/solr.xml /usr/local/tomcat/conf/Catalina/solr.xml
-rw-r--r--. 1 root root 169 May 6 14:38 /opt/solr/solr.xml
-rw-r--r--. 1 root root 169 May 6 14:38 /usr/local/tomcat/conf/Catalina/solr.xml
These are the contents of my /opt/solr directory
# ls -l /opt/solr/
total 436
drwxr-xr-x. 3 root root 4096 May 6 14:37 admin
-rw-r--r--. 1 root root 176647 Dec 18 2012 CHANGES.txt
drwxr-xr-x. 3 root root 4096 May 6 12:48 client
drwxr-xr-x. 9 root root 4096 Dec 18 2012 contrib
drwxr-xr-x. 3 root root 4096 May 6 12:48 dist
drwxr-xr-x. 3 root root 4096 May 6 12:48 docs
-rw-r--r--. 1 root root 1274 May 6 13:28 elevate.xml
drwxr-xr-x. 11 root root 4096 May 6 12:48 example
-rw-r--r--. 1 root root 81331 Dec 18 2012 LICENSE.txt
-rw-r--r--. 1 root root 20828 Dec 18 2012 NOTICE.txt
-rw-r--r--. 1 root root 5270 Dec 18 2012 README.txt
-rw-r--r--. 1 root root 55644 May 6 13:27 schema.xml
-rw-r--r--. 1 root root 60884 May 6 13:27 solrconfig.xml
-rw-r--r--. 1 root root 169 May 6 14:38 solr.xml
Yet, when I bounce tomcat, this is the result that I get:
HTTP Status 404 - missing core name in path
type Status report
message missing core name in path
description The requested resource is not available.
Cany anyone tell me what I'm doing wrong?
Thanks!!
it seems that your search server uses a multi core setup.
In that case you need your core name as part of the URL.
e.g. instead of requesting
http://localhost:8983/solr/select/?q=text
you have to request
http://localhost:8983/solr/yourCoreName/select/?q=text
please check whether solr home is defined in your WEB-INF/web.xml.
Check out this similar question for some similar and different solutions.
HTTP ERROR: 404 missing core name in path with solr
Getting "missing core name in path" when trying to access Solr admin installed on Glassfish
I'm using Apache::Test to test an Apache handler that I'm writing. My build environment is a Docker container, created from this Dockerfile:
FROM google/debian:wheezy
RUN apt-get -y install make gcc build-essential
RUN apt-get -y install sudo
RUN apt-get -y install apache2-threaded-dev
RUN apt-get -y install libapache2-mod-perl2 libgd-gd2-perl libgd-tools
RUN apt-get -y install libtest-harness-perl
RUN apt-get -y install libtap-formatter-junit-perl libjson-perl
I build the container and run it via:
docker run -i -t --rm -v $PWD:/opt/51d device-detection:latest /opt/51d/entry.sh
Apache::Test doesn't allow the httpd server to start as root and my container is running as root, so the entry.sh script creates a user for the test to use by doing:
#!/bin/bash
adduser --disabled-password --gecos '' r
adduser r sudo
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
su -m r -c /opt/51d/build
And build looks like:
perl Makefile.PL && make && make test && sudo make install
Apache::Test provides a test harness called t/TEST. I can start the Apache server just fine with:
t/TEST -start-httpd
And I can access the index.html page just fine with:
wget http://localhost:8529/index.html
However, when I attempt to access a CGI script, I get:
[Thu Apr 02 23:12:11 2015] [error] (1)Operation not permitted: Couldn't bind unix domain socket /opt/51d/CDK-51DegreesFilter/t/logs/cgisock.267
[Thu Apr 02 23:12:11 2015] [notice] Apache/2.2.22 (Debian) mod_perl/2.0.7 Perl/v5.14.2 configured -- resuming normal operations
[Thu Apr 02 23:12:11 2015] [info] Server built: Dec 23 2014 22:48:32
[Thu Apr 02 23:12:11 2015] [debug] worker.c(1757): AcceptMutex: sysvsem (default: sysvsem)
[Thu Apr 02 23:12:11 2015] [crit] cgid daemon failed to initialize
[Thu Apr 02 23:12:30 2015] [error] [client 127.0.0.1] (2)No such file or directory: unable to connect to cgi daemon after multiple tries: /opt/51d/CDK-51DegreesFilter/t/cgi-bin/index.cgi
The /opt/51d/CDK-51DegreesFilter/t/logs/ directory is wide open:
ls -ld t/logs/
drwxrwxrwx 1 r staff 136 Apr 2 23:24 t/logs/
=====
Made some progress by moving the location of the ScriptSock directory
<IfModule mod_cgid.c>
ScriptSock /tmp/cgisock
</IfModule>
New error message is:
[Sat Apr 04 04:04:23 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Sat Apr 04 04:04:23 2015] [notice] Apache/2.2.22 (Debian) mod_perl/2.0.7 Perl/v5.14.2 configured -- resuming normal operations
[Sat Apr 04 04:04:23 2015] [info] Server built: Dec 23 2014 22:48:32
[Sat Apr 04 04:04:23 2015] [debug] worker.c(1757): AcceptMutex: sysvsem (default: sysvsem)
[Sat Apr 04 04:04:49 2015] [error] (2)No such file or directory: exec of '/opt/51d/CDK-51DegreesFilter/t/cgi-bin/index.cgi' failed
[Sat Apr 04 04:04:49 2015] [error] [client 127.0.0.1] Premature end of script headers: index.cgi
[Sat Apr 04 04:06:14 2015] [error] (2)No such file or directory: exec of '/opt/51d/CDK-51DegreesFilter/t/cgi-bin/index.cgi' failed
[Sat Apr 04 04:06:14 2015] [error] [client 127.0.0.1] Premature end of script headers: index.cgi
=====
Fixed the exec error as the location of the perl binary is different. Updated that and all is well.
t/TEST
[warning] setting ulimit to allow core files ulimit -c unlimited; /usr/bin/perl /opt/51d/CDK-51DegreesFilter/t/TEST
/usr/sbin/apache2 -d /opt/51d/CDK-51DegreesFilter/t -f /opt/51d/CDK-51DegreesFilter/t/conf/httpd.conf -D APACHE2 -D PERL_USEITHREADS
using Apache/2.2.22 (worker MPM)
waiting 60 seconds for server to start: ..
waiting 60 seconds for server to start: ok (waited 1 secs)
server localhost:8529 started
t/CDK-51DegreesFilter.t .. ok
All tests successful.
Files=1, Tests=6, 0 wallclock secs ( 0.02 usr 0.02 sys + 0.34 cusr 0.08 csys = 0.46 CPU)
Result: PASS
[warning] server localhost:8529 shutdown
[warning] port 8529 still in use...
done
I had similar issue today.. Using valid scriptsock resolved my issue..
<IfModule cgid_module>
#
# ScriptSock: On threaded servers, designate the path to the UNIX
# socket used to communicate with the CGI daemon of mod_cgid.
#
Scriptsock /usr/local/apache2/cgisock
</IfModule>
We have developed one project on cakephp for a govt. entity. After development the server provider for this govt. entity told us that they won't be providing 777 file permission on the server as this is against their guidelines. Now we need a solution to run this with 775 file permission. Any way out for this ?
This is what they told us
"Write and Read Permission can be given to only one folder i.e WriteReadData. No customized folder is allowed. Yes you can create as many folder under WriteReadData folder. And in Web Server environment only 775 permission."
Please suggest how to run this application.
I don't see a real problem in there ?
Just check your tmp folder, here is a link for more infos -> here
777 permissions are not required
Or a good idea.
The problem is really ownership, not permissions. An app should always run on the principle of least privilege, i.e. the minimum permissions to permit it to function. Applied to the tmp folder (which is the only folder that needs to be writable) that could simply mean:
[ app ]
-> chown -R www-data:www-data tmp
[ app ]
-> chmod -R 700 tmp
[ app ]
-> ls -la
total 44
dr-xr-xr-x 11 root root 4096 May 20 14:46 .
dr-xr-xr-x 6 root root 4096 Jun 11 15:28 ..
dr-xr-xr-x 2 root root 4096 Jun 13 07:34 Config
dr-xr-xr-x 3 root root 4096 May 22 14:10 Console
dr-xr-xr-x 3 root root 4096 May 22 14:10 Controller
dr-xr-xr-x 14 root root 4096 May 6 09:42 Locale
dr-xr-xr-x 3 root root 4096 May 15 09:21 Model
dr-xr-xr-x 3 root root 4096 Feb 25 10:40 Plugin
drwx------ 5 www-data www-data 4096 Apr 23 14:33 tmp
dr-xr-xr-x 10 root root 4096 Feb 25 10:40 View
dr-xr-xr-x 7 root root 4096 Jun 11 15:28 webroot
Where www-data is the webserver user.