useradd username
passwd username
whereis sudoers
ls -l /etc/sudoers 查看文件权限
chmod -v u+w /etc/sudoers 修改文件权限为可编辑
vim /etc/sudoers 进入文件编辑器
文件内容改变如下:
root ALL=(ALL) ALL 已有行
username ALL=(ALL) ALL 新增行
ls -l /etc/sudoers 查看文件权限
chmod -v u-w /etc/sudoers 修改文件权限为只读
root ALL=(ALL) ALL 已有行
username ALL=(ALL) ALL 新增行
apache ALL=(username) NOPASSWD: /usr/bin/git, /usr/bin/php, /bin/bash 新增行
username ALL=(ALL) ALL
apache ALL=(username) NOPASSWD: /usr/bin/git, /usr/bin/php, /bin/bash
写在前面 : apache中虚拟站点指向的目录的上级必须是755 如/home/wwb/website,那么home与wwb与website都必须是755,而不是只设置/home/yyz/website就行了 这样的话会报错403
sudo yum install httpd
sudo systemctl restart httpd
sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
sudo yum install mysql mysql-server
sudo service mysqld start
方式一
mysql -u root mysql
use mysql
update user set Password=password('6Cgooyy9alv') where user='root';
方式二
mysql_secure_installation
sudo service mysqld restart
GRANT USAGE ON *.* TO 'beta'@'localhost' IDENTIFIED BY 'beta123456' WITH GRANT OPTION;
#分配mysql用户权限
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON pe762_beta.* TO 'beta'@'localhost';
rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
#以下是CentOS 7.0的源。
yum install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-gd php-redis
yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm
#进入apache的配置文件中查看是否含有以下配置 若无添加
LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.html index.php
DocumentRoot "/home/wwb/website/project/web"
ServerName www.hehe.cn
DirectoryIndex app.php
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
ErrorLog /home/yyz/website/project-error_log
CustomLog /home/yyz/website/project-access_log common
sudo yum install -y git
ssh-keygen -t rsa -C git@account"
cat ~/.ssh/id_rsa.pub #此处将获取的公钥复制下来后登录码云在公钥进行设置(详情查看git帮助文档https://gitee.com/help/articles/4181#article-header0)