w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
CentOS Webserver: Best practice for creating SSH user that is friendly with Nginx
You need to modify File Access Control. Try these commands by swapping out bob with your specific user and specific path to your web root. That way your newly created user will have to ability to read/write/execute files without the need to modify permissions. setfacl -R -d -m u:bob:rwx /var/www/mydomain.com setfacl -R -m u:bob:rwx /var/www/mydomain.com Here is further reading if you would like to know more. http://linuxcommand.org/man_pages/setfacl1.html Let me know if it helped.

Categories : Linux

Web Deploy Command Line Logs in Event Logs (Updated / Inserted / Deleted Files) in event logs
I don't believe you can log the activities to the event log, but what you can do is use the -xml parameter to output the changes in XML format. You could then use this to log to the event log via a Powershell script, for example.

Categories : Iis

Where is my nginx being configured? Changing nginx.conf still brings me to the 'Welcome to nginx' page
when you rewrited the nginx.conf in the folder of source code of nginx and installed it firstly, it will be copied to /usr/local/nginx/conf/nginx.conf (without specially modification of the configure in the folder of source code). But when you do this secondly, the nginx.conf in the folder of source code will be copied to /usr/local/nginx/conf/nginx.conf.defualt,and it usually don't work unless you use nginx -c /usr/local/nginx/conf/nginx.conf.defualt to assign its configure file evertime. There is a line NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" in your script above,which indicates the configure file clearly. To handle this, I suggest rewrite /usr/local/nginx/conf/nginx.conf (not the one in the folder of source code) instead.

Categories : Nginx

How to conveniently store common logs and client specific logs
I would have an xml file that contain the appenders to specify what packages go into what log file. You can then load the xml file in your application entry point. Below is an example I have used in my current project <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <!-- appenders --> <appender name="console" class="org.apache.log4j.ConsoleAppender"> <param name="Target" value="System.out" /> <param name="threshold" value="error" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%t] %p %c - %m%n" /> </layout> </appender> <appender name="codebaseXAppender" class="org.apache.log4j.RollingFileAppender"> <

Categories : Java

How to set intellij to show logs in the logs tab and not the output tab
In the application server Run/Debug configuration open the Logs tab and specify the full log file path there. You can just search your disk for algo_js.log file and specify its location.

Categories : Spring

FBSession.activeSession.permissions does not appear to accurately depict the valid granted permissions
If you were using iOS SDK 3.0, then this was due to a bug in the SDK. See the bug report for more details. Symptom summary: After authorizing user with openActiveSessionWithPermissions method, the sessions variable in callback method contains extended permissions that were not allowed by a user.

Categories : IOS

Get iPhone Logs(not crash logs)
Got a breakthrough!!. We need to re-direct NSLog to a file like this and then access the file. - (void)redirectNSLogToDocumentFolder{ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *fileName =[NSString stringWithFormat:@"%@.log",[NSDate date]]; NSString *logFilePath = [documentsDirectory stringByAppendingPathComponent:fileName]; freopen([logFilePath cStringUsingEncoding:NSASCIIStringEncoding],"a+",stderr); } http://objcolumnist.com/2009/12/19/redirecting-nslog-to-a-log-file/

Categories : IOS

Restarting nginx: nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable
Passenger takes what you set in the file nginx.conf by passenger_ruby, for example: passenger_root /home/dev/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.5; passenger_ruby /home/dev/.rvm/wrappers/ruby-1.9.3-p448/ruby;

Categories : Ruby

Can a server run Nginx for some sites and Apache Nginx Reverse Proxy for others?
server { server_name example.com; location / { # assuming apache is on port 81 for example proxy_pass http://127.0.0.1:81; # to make apache detect the host header proxy_set_header Host $host; } # if you have assets folders, you can let nginx serve them directly, # instead of passing them to apache location /images { # or /css or /js .. etc try_files $uri =404; } } Note: in the case of assets, sometimes some sites serve assets through rewrites, or even handled by the application it self, you can pass it to apache by adding that in the assets location as a fallback like this location /images { try_files $uri @apache; } location @apache { proxy_pass http://127.0.0.1:81; } In apache you create a virtual host <Virtua

Categories : Apache

How to set world permissions to be the same as group permissions?
From the chmod(1) man page (relevant parts extracted): -R Change the modes of the file hierarchies rooted in the files instead of just the files themselves. And: The symbolic mode is described by the following grammar: who ::= a | u | g | o op ::= + | - | = perm ::= r | s | t | w | x | X | u | g | o The who symbols "u", "g", and "o" specify the user, group, and other parts of the mode bits, respectively. The who symbol a is equivalent to ugo. The perm symbols represent the portions of the mode bits as follows: g The group permission bits in the original mode of the file. So for you: chmod -R o=g * Example: $ ls -l total 0 drwxr-x--- 2 carl staff 68 Jun 28 10:25 example.d -rw-r----- 1 carl staff 0 Jun 28 10

Categories : Bash

I can't run cqlengine on centos
You need to upgrade python on your centos box. It looks like you're using python 2.6 on your centos box. Set comprehensions (what's happening in the cqlengine file) were not introduced until python 2.7. That's most likely your problem.

Categories : Django

Can I downgrade gcc in centos 64 bit?
Actually I think 4.4.7 will be OK. If you're having trouble using 4.4.7, please post a new question with the details of the problems you are having. Although the link you reference mentions 4.4.5, that simply means what CUDA was tested with. If you look in /usr/local/cuda/include/host_defines.h you will see that the enforced limit is 4.6.x or below: #if defined(__GNUC__) #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6) #error -- unsupported GNU version! gcc 4.7 and up are not supported! #endif /* __GNUC__> 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6) */ #endif /* __GNUC__ */ If you really want to install a different gcc/g++, it is possible, you can search on those topics on stack overflow, or on the web. Here's one example on the web of a how-to s

Categories : Linux

Apache, PHP, Centos 6
Make sure you have the PHP module loaded. Somewhere in your config you should see something like: LoadModule php5_module modules/libphp5.so Then, make you you add a handler to handle files with the php extension: AddHandler application/x-httpd-php .php .php5 .phtml AddHandler application/x-httpd-php-source .phps

Categories : PHP

AWS s3fs - CentOS 6.4
I generally recommend against s3fs. Its not that it can't work, but it creates the expectation that the mount is a block device when it isn't. S3 stores files as complete objects. Operations are on the object in its entirety. This is in contrast to a disk volume where operations are done on blocks. As such, certain tools and operations don't work well with s3fs. Under the covers, files accessed on s3fs are actually cached locally on the disk.

Categories : Amazon

mysql 5.5 on centos 6.4
One way is to install all the RPMs at the same time with yum install MySQL*.rpm, which ideally should take care of all package dependencies and upgrades. You can also get around this problem by using the --replacefiles option to RPM: rpm -ivh --replacefiles MySQL-server-5.5.32-1.el6.x86_64.rpm That uses the error message language files from the server package to overwrite those in the 5.1 version that comes with CentOS.

Categories : Mysql

CentOS, sendmail no corresponding with PHP
(Started as a comment but it's getting a bit long) You've provided no details of any attempt to resolve this yourself. What have you tried? It would be helpful if you provided the output of: <?php $mc=ini_get('sendmail_path'); print "config: $mc <br /> "; $p=explode(' ', $mc); if ($p[0]) { passthru("ls -l " . $p[0]); } else { print "no mua "; } print "<br /> "; print "running as " . posix_getlogin() . " <br />";

Categories : PHP

installing NTP on CentOS 6
It seems like your active repo do not provide all needed packages. Try to add a repo (ex. EPEL) For a detailed howto install see http://fedoraproject.org/wiki/EPEL After that try again to install ntp with yum install ntp

Categories : Linux

How do I install SSH2 for PHP 5.5 on Centos 6.4 64 bit?
There is no need to modify your php.ini. You may set the memory limit for the current command using -d. See: pecl help options pecl -d memory_limit=500M install -f ssh2 You may install this module also using yum from epel repo: rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm yum install php-pecl-ssh2

Categories : PHP

Php 5.3 mcrypt not working on CentOS 6.3 32-bit
This seem to be a issue in the 32bit version of mcrypt when using yum install php-mcrypt to install. Take a look @ Installing php-mcrypt on centos 6.4 (32 bytes) causes problem, the mcrypt.ini file has the wrong entry You need to edit /etc/php.d/mcrypt.ini and change extension=module.so To extension=mcrypt.so Then save and restart apache.

Categories : PHP

Cannot install RStudio on CentOS 6.4
I fixed this error following this link: http://jermdemo.blogspot.com.es/2011/08/installing-rstudio-server-on-scientific.html You have to install some dependencies: yum install libcrypto.so.6 -y yum install libgfortran.so.1 -y yum install libssl.so.6 -y yum install openssl098e-0.9.8e -y yum install gcc41-libgfortran-4.1.2 -y yum install pango-1.28.1 -y and the tricky one: wget ftp.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/compat- libgfortran-41-4.1.2-39.el6.x86_64.rpm rpm -Uvh compat-libgfortran-41-4.1.2-39.el6.x86_64.rpm and install Rstudio with no-deps flag: rpm -Uvh --nodeps rstudio-server-0.97.336-x86_64.rpm rstudio-server verify-installation

Categories : R

X-SendFile not working on centos
In .htacess file you have <Files files.php> XSendFile on </Files> and the files.php is <?php $file = "path_to_your_file"; $finfo = new finfo; $mime = $finfo->file($file, FILEINFO_MIME_TYPE ); if (in_array('mod_xsendfile', apache_get_modules())) { header("X-Sendfile: $file"); header("Content-type: $mime"); //header ('Content-Disposition: attachment; filename="image"'); } ?> dont forget to change cofig AllowOverride All for .htaccess

Categories : PHP

PHP modules on CentOS Server - Which ones do I need?
I may not have the complete list, but here would be some suggestions: php-mysql php-pdo php-pear php-pecl php-xml If I were you, however, I would install the PEAR package manager, and install all your required extensions or modules from that. Seems like that would be easier to manage all your php libraries from a single source, because I would bet that at some point you'll want to use a php library that's not available via your yum repository.

Categories : PHP

Building gvim 7.4 on CentOS 6.4
The trick seems to be setting a proper vimruntime dir while invoking make, and having below ones --enable-gui=gnome2 --with-x=yes in list of switches for configure script. Here's my test build script which seems to be giving the required result. mkdir /tmp/vimbuild; cd /tmp/vimbuild wget -c ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2 tar -xjvf vim-7.4.tar.bz2 cd vim74 m -rf src/auto/config.cache make clean ./configure --prefix=/usr --with-compiledby="megazoe" --with-features=huge --enable-rubyinterp --enable-pythoninterp --enable-python3interp --disable-tclinterp --with-x=yes --enable-xim --enable-multibyte --enable-gui=gnome2 --enable-luainterp --enable-perlinterp --enable-cscope

Categories : Linux

Installing pyodbc on CentOS 5
Management Summary: This error suggests that you don't have your build environment set up right, OR that your build process is mucking things up a bit. Details: uintptr_t is an optional part of the ISO C99 language spec and comes from stdint.h. That said, I'm pretty sure GCC has had it for ages. I'd check your compiler's include path to ensure that that file exists within it. Possible sources of problems include: Your build tools are not configured properly, and compiling most anything non-trivial shouldn't work if this is the case. Your compiler is ancient and out of date. That seems unlikely since CentOS shipped with.. GCC 4.1.2 (I think?), and I'm pretty sure that's plenty new enough. Your build process here is somehow confusing GCC and getting it to not include the standard in

Categories : Python

CentOS 6.4 X86_64 Uses too much RAM and SWAP
If you look at your memory using "htop" you would see that the memory bar has 3 colors. I would guess that most of the memory used is yellow in your case. Basically your memory is being used by various OS caches. These caches are pushed out of the memory as your system needs. The system holds on to the ram copy so that centos can execute faster if same commands/programs are executed again while the data is still in memory cache. This explains why you are only part of the memory used is release once the app is closed. This has never been a cause of slow down for me. I have experienced firefox memory usage balloon on as you keep using. Perhaps it is a virtualization platfrom issue. What is your host os and what virtualization platfrom are you using?

Categories : PHP

jfsutils install on CentOS plus
For CentOS 5.9, jfsutils is available in the centosplus repo so you need to make sure that repo is enabled. Alternatively, you should be able to run yum --enablerepo=centosplus install jfsutils

Categories : Linux

Install php-mcrypt on CentOS 6
There are two ways you can address this: Download php-mcrypt from fedora: http://injustfiveminutes.wordpress.com/2012/11/23/install-php-mcrypt-extension-on-rhel-6/ Check if you're facing a known bug with a wrongly packaged php-mcrypt extension: http://www.sterndata.com/blog/phymyadmin-mcrypt-and-centos-6-mcrypt-extension-missing-solved

Categories : PHP

Best way to install MySQL 5.6 on Centos 6.4
It doesn't surprise me that MySQL is a bit behind. Why would Oracle make it easy for you to not use pay-for Oracle? </rant> Anyway, you can get the awkwardly named, but otherwise identical MariaDB to run easily by adding a new YUM repository.

Categories : Mysql

Export Proxy for Git on Centos 6.3
http.proxy ssh: connect to host github.com port 22 See the difference? SSH won't go through HTTP proxy. The easiest soultion is to use GitHub's HTTPS protocol instead.

Categories : GIT

TCLBLEND FAILURE - Centos 6.4
If you read the error message trace, you'll see that it says that this is all caused by: libjava.so: cannot open shared object file: No such file or directory The first steps would then be to ensure that you've got a version of Java actually installed, to check that it includes the file libjava.so, and that the file has been indexed by the system shared library catalog. It might also be worth checking that all its dependencies are also present and that you've got the architecture for the Tcl library and the Java library matched (e.g., both 32-bit) as those can cause odd failures when they go wrong.

Categories : Java

Using Sleep command in Crontab CentOS
Remove root from sleep 5 && root /usr.. If you want to run it as root, the correct format is: * * * * * root sleep 5 && /usr/bin/php /path/to/the/php/file.php

Categories : PHP

Trouble Installing M2Crypto on CentOS
If you can't get the system admin for the computer to install it for you then download the tarball from http://www.swig.org/download.html, untar it and execute ./configure --prefix=/home/username/bin then do the normal make and make install. After that make sure that /home/username/bin is in your PATH environment so the system knows to look there. Hope this helps, but in the future, installation questions like this are not for SO, try SuperUser instead for that.

Categories : Python

How to deploy CakePHP-application on CentOS?
Simply read the log and try to understand it. It pretty clearly tells you what has insufficient permissions. The linux command to set permissions is chmod. You also want to make sure, as the text already tells you, that your CakePHP core include path is correct. Double check that too.

Categories : Cakephp

VirtualHost on Apache Server -- CentOS
try adding these to your httpd.conf <VirtualHost IP:80> DocumentRoot /fullpath/to/ca/crl/ ServerName CA-Test.abc.net </VirtualHost> Now restart your httpd and try browsing the url http://CA-Test.abc.net/root.crl Now public can't access the contents in the folder "ca". Let us know if that helped you.

Categories : Apache

Cron job doesn't run (Perl & Centos)
Don't edit the crontab file directly. Instead use crontab -e and add the cron entry. With reference to the link

Categories : Perl

How to install python for one user on centos?
Try using virtualenv. Of course this assumes that your system already has virtualenv installed. https://pypi.python.org/pypi/virtualenv Basic usage: virtualenv venv That creates a directory called 'venv' at your current folder. It puts in the appropriate python and pip binaries. To go into the virtual environment: . venv/bin/activate or equivalently: source venv/bin/activate That is the key step. From then on, any packages installed using pip will be local to the virtualenv folder that we created above. Remember to do the above step before installing your packages and running your programs. Running python will also use the python from the virtualenv. You should see something like: (venv)[username@host]$ on your shell. Install packages using pip like this: pip install pack

Categories : Python

apache-tomcat-7 is not starting on centos
Maybe my experience is useful for somebody. I deployed a WAR file (the deployed web application was writing some file on hard). I forgot to undeploy WAR file from tomcat and before undeployment, I just delete my web application from my computer hard disk. When I tried to start Tomcat (/Library/Tomcat/bin/startup.sh), there was no error, but I could not open http://:8080/ on any browsers, and when I tried to shutdown Tomcat (/Library/Tomcat/bin/shutdown.sh), I got the above mentioned error (SEVERE: Could not contact localhost:8005. Tomcat may not be running). I use this command (/Library/Tomcat/bin/catalina.sh run) and I understood the above problem. Then I created the missing file, and start the tomcat, then undeploy the previously-deleted WAR file from tomcat and then shutdown tomcat (

Categories : Tomcat

PHPMailer doesn't work on CentOS
Okay, after I checked everything, it turns out google block my email access from the server because of suspicious activity. To unblock this, you need to visit this page : https://accounts.google.com/DisplayUnlockCaptcha and then run the script again.

Categories : PHP

Centos 6 lamp server security
This is probably off-topic for stackoverflow, you might look at serverfault. However, some quick hints: Disable access to all unnecessary ports, probably by configuring iptables. You shouldn't need to open more than 22,80, and 443. If you do run ssh, edit /etc/ssh/sshd_config and disable root login. I recommend DenyHosts as well. Turn SELinux back on. You just need to use setsebool to enable the right things. This might be all you need $ sudo setsebool httpd_can_network_connect_db 1 This will let you look at related booleans. $ getsebool -a | egrep '(http|php)'

Categories : Wordpress

What is the equivalent switch to /MT (VC++) for g++ in linux (CentOS)?
I'm guessing that you mean that your users have to install Intel Threading Building Blocks (TBB) on their Linux machines. If you're using the Intel TBB functionality and your clients have to compile your source code then they need to have Intel TBB installed. An alternative approach would be to compile the source code for your clients and only supply them with your solution binaries and not the source code - then they would not have to install TBB.

Categories : C++



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.