找不到my default.cnfdefault.conf文件怎么破

匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。grub的配置文件/boot/grub/grub.conf损坏导致系统不能启动
在/boot/grub/grub.conf 配置文件中指定了内核的其中目录,如果它被破坏了,启动系统时就会直接进入到grub
的提示符界面
/boot/grub/grub.conf 配置文件
default& 设定默认启动的title编号,从0开始
timeout 设定等待用户选择的超时时长
splashimage&& 设定grub的背景图片
&hiddenmenu&&&
隐藏菜单, & 添加这一项代表隐藏grub菜单
& password redhat &
& 指定grub密码,免得别人进入单用户模式
也可使用加密的密码
&pasword --md5& 加密过后的密码
#grub-md5-crypt&&&&
指定的密码&&&&&
得到指定密码的加密后的密码集
&title Red Hat Enterprise Linux
(2.6.32-71.el6.x86_64)& 内核或操作系统名称,字符串可自由修改
(hd0,0)&&&&
内核文件所在的设备,对grub而言,所有类型的硬盘一律为(hd#,N),#表示第几个磁盘,最后的N表示对应的磁盘分区;
&&& kernel
/vmlinuz-2.6.32-71.el6.x86_64 ro
root=UUID=fe215ee8-37e7-425e-8c70- rd_NO_LUKS rd_NO_LVM
rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16
KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb
quiet&& 内核文件路径,及传递给内核的参数
&&& initrd
/initramfs-2.6.32-71.el6.x86_64.img&&
ramdisk文件路径initrd
当grub的配置文件损坏时
可以进入grub界面手动引导系统启动
如果不知道内核在哪一个盘里面,可以使用root探测一下
还可以使用find 命令,找一下内核在那个盘里面
找到之后开始设定
grub& root (hd#,N)
grub& kernel /PATH/TO/KERNEL_FILE
grup& initrd /PATH/TO/INITRD_FILE
设定完成后,grub& boot& 重新引导系统启动
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。redis配置文件的位置
我在这问一个自己感觉有点白痴的问题,redis配置文件的位置我找不到,就是redis.conf文件的位置,我是直接wget下来,加压后直接make安装的,安装之前还装了tcl.我现在想找配置文件的位置不知道怎么找,MySQL直接show一下就可以。
以下是问题补充:
:[root@juphon ~]# redis-server
1962:C 21 Oct 01:52:12.016 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1962:M 21 Oct 01:52:12.017 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_.-``__ ''-._
Redis 3.0.5 () 64 bit
.-`` .-```.
_.,_ ''-._
Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'|
Port: 6379
http://redis.io
`-._`-.__.-'_.-'
`-._`-.__.-'_.-'
1962:M 21 Oct 01:52:12.018 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1962:M 21 Oct 01:52:12.018 # Server started, Redis version 3.0.5
1962:M 21 Oct 01:52:12.018 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1962:M 21 Oct 01:52:12.018 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never & /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1962:M 21 Oct 01:52:12.018 * DB loaded from disk: 0.000 seconds
1962:M 21 Oct 01:52:12.018 * The server is now ready to accept connections on port 6379
你怎么启动的redis-server的?
ps -ef|grep redis-server 看看你启动的时候有没有指定redis.conf。没有指定的话redis在内部自动维持一套配置。
--- 共有 4 条评论 ---
: 如果你想自己指定配置文件,直接启动的时候把配置文件作为命令行参数就好了
./redis-server redis.conf
[root@juphon ~]# ps -ef|grep redis-server
0 02:01 pts/0
00:00:00 redis-server *:6379
0 02:02 pts/1
00:00:00 grep redis-server
Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
你说的可能是这个
我直接用redis-server就启动了,照着书上操作的
redis-server --help
redis tar包解压后,能看到一个文件名为redis.conf的配置文件,你可以copy出来一份,然后设置自己想要的配置,启动redis时,指定这个修改的配置文件。
you can run this command to find where the file loacted:
sudo find / -type f -name 'redis.conf'中国领先的IT技术网站
51CTO旗下网站
在Ubuntu 14.04 LTS系统中设置Apache虚拟主机
虚拟主机常用于在一个单独的IP地址上提供多个域名的网站服务。如果有人想在单个VPS的单个IP地址运行多个网站,这是非常有用的。在这个教程中,让我告诉你如何设置在Ubuntu 14.04 LTS的Apache网页服务器设置虚拟主机。请注意,这个教程只针对Ubuntu14.04的32位版本。
作者:disylee译来源:| 10:40
虚拟主机常用于在一个单独的IP地址上提供多个域名的网站服务。如果有人想在单个VPS的单个IP地址运行多个网站,这是非常有用的。在这个教程中,让我告诉你如何设置在Ubuntu 14.04 LTS的Apache网页服务器设置虚拟主机。请注意,这个教程只针对Ubuntu14.04的32位版本。
我不保证它也可以工作在其它更低的Ubuntu版本或者Ubuntu衍生版本(虽然可能过程是类似的)。
在这个教程中,我会使用Ubuntu 14.04 32位 LTS,并搭建2个测试网站分别命名为&unixmen1.local& 和 &unixmen2.local&.我的测试机分别为192.168.1.250/24和server.unixmen.local。你可以根据你的需要更改虚拟域名。
安装Apache网站服务器
安装apache服务器之前,我们来更新一下我们的Ubuntu服务器:
sudo apt-get update
然后,用下面命令来安装apache网络服务器:
sudo apt-get install apache2
安装apache服务器之后,让我们通过这个URL&http://你的服务器的IP地址/&来测试网站服务器是否正常工作
如你所见,apache服务器已经工作了。
设置虚拟主机
1.创建虚拟目录
现在,让我们继续安装虚拟主机。正如我先前所述,我要新建2台虚拟主机分别命名为&unixmen1.local&和&unixmen2.local&.
创建一个公用的文件夹来存放这两台虚拟主机的数据。
首先,让我们为unixmen1.local这个站点创建一个目录:
sudo mkdir -p /var/www/unixmen1.local/public_html
接着,为for unixmen2.local站点创建一个目录:
sudo mkdir -p /var/www/unixmen2.local/public_html
2. 设置所有者和权限
上面目录现在只有root拥有权限。我们需要修改这2个目录的拥有权给普通用户,而不仅仅是root用户。
sudo chown -R $USER:$USER /var/www/unixmen1.local/public_html/sudo chown -R $USER:$USER /var/www/unixmen2.local/public_html/
&$USER&变量指向了当前的登录用户。
设置读写权限给apache网页根目录(/var/www)及其子目录,这样每个人都可以从目录中读取文件。
sudo chmod -R 755 /var/www/
这样,我们就创建好了一些文件夹来保存网络相关数据并分配必要的权限和所属用户。
3. 为虚拟主机创建示例页
现在,我们给网站增加示例页。第一步,让我们给虚拟主机unixmen1.local创建一个示例页。
给unixmen1.local虚拟主机创建一个示例页,
sudo vi /var/www/unixmen1.local/public_html/index.html
添加以下内容:
&html&&head&&title&www.unixmen1.local&/title&&/head&&body&&h1&Welcome To Unixmen1.local website&/h1&&/body&&/html&
保存并关闭文件。
同样的,添加示例页到第二台虚拟主机。
sudo vi /var/www/unixmen2.local/public_html/index.html
添加以下内容:
&html&&head&&title&www.unixmen2.local&/title&&/head&&body&&h1&Welcome To Unixmen2.local website&/h1&&/body&&/html&
保存并关闭文件。
4. 创建虚拟主机配置文件
默认情况下,apache有一个默认的虚拟主机文件叫000-default.conf。我们将会复制000-default.conf文件内容到我们新的虚拟主机配置文件中。
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/unixmen1.local.confsudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/unixmen2.local.conf
确保虚拟主机配置文件末尾包含.conf扩展名。
现在,修改unximen1.local.conf文件以符合需求。
sudo vi /etc/apache2/sites-available/unixmen1.local.conf
使相关的变化直接呈现在unixmen1站点中(译注:以&#&开头的注释行可以忽略。)。
&VirtualHost *:80&# The ServerName directive sets the request scheme, hostname and port that# the server uses to identify itself. This is used when creating# redirection URLs. In the context of virtual hosts, the ServerName# specifies what hostname must appear in the request's Host: header to# match this virtual host. For the default virtual host (this file) this# value is not decisive as it is used as a last resort host regardless.# However, you must set it for any further virtual host explicitly.#ServerName &ServerAdmin webmaster@unixmen1.localServerName unixmen1.localServerAlias www.unixmen1.localDocumentRoot /var/www/unixmen1.local/public_html&# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,# error, crit, alert, emerg.# It is also possible to configure the loglevel for particular# modules, e.g.#LogLevel info ssl:warn&ErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined&# For most configuration files from conf-available/, which are# enabled or disabled at a global level, it is possible to# include a line for only one particular virtual host. For example the# following line enables the CGI configuration for this host only# after it has been globally disabled with &a2disconf&.#Include conf-available/serve-cgi-bin.conf&/VirtualHost&
同理,修改第二台主机文件。
sudo vi /etc/apache2/sites-available/unixmen2.local.conf
使相关的修改在unixmen2 站点呈现出来。
&VirtualHost *:80&# The ServerName directive sets the request scheme, hostname and port that# the server uses to identify itself. This is used when creating# redirection URLs. In the context of virtual hosts, the ServerName# specifies what hostname must appear in the request's Host: header to# match this virtual host. For the default virtual host (this file) this# value is not decisive as it is used as a last resort host regardless.# However, you must set it for any further virtual host explicitly.#ServerName &ServerAdmin webmaster@unixmen2.localServerName unixmen2.localServerAlias www.unixmen2.localDocumentRoot /var/www/unixmen2.local/public_html&# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,# error, crit, alert, emerg.# It is also possible to configure the loglevel for particular# modules, e.g.#LogLevel info ssl:warn&ErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined&# For most configuration files from conf-available/, which are# enabled or disabled at a global level, it is possible to# include a line for only one particular virtual host. For example the# following line enables the CGI configuration for this host only# after it has been globally disabled with &a2disconf&.#Include conf-available/serve-cgi-bin.conf&/VirtualHost&
修改虚拟主机文件后,禁用默认的虚拟主机配置(000.default.conf),然后启用新的虚拟主机配置,如下所示。
sudo a2dissite 000-default.confsudo a2ensite unixmen1.local.confsudo a2ensite unixmen2.local.conf
最后,重启apache服务器。
sudo service apache2 restart
就是这样。现在,我们成功地配置了apach虚拟主机在我们的Ubuntu服务器上
测试虚拟主机
编辑/etc/hosts文件,
sudo vi /etc/hosts
在文件末尾添加如下所示的虚拟域名。
192.168.1.250
unixmen1.local192.168.1.250
unixmen2.local
保存并关闭文件。
打开你的浏览器并访问&或&。你将会看到我们之前创建的示例页。
Unixmen1.local 测试页:
Unixmen2.local 测试页
如果你想从你的远程系统访问这些站点,你需要在你的DNS服务器添加实际域名记录。不过,我没有真实的域名和DNS服务器,我只想通过我的本地系统测试,那么它刚好如我所愿地工作。
译者:&校对:【编辑推荐】【责任编辑: TEL:(010)】
大家都在看猜你喜欢
原创头条头条外电头条
24H热文一周话题本月最赞
讲师:0人学习过
讲师:0人学习过
讲师:5人学习过
精选博文论坛热帖下载排行
《系统分析师考试辅导(2007版)》内容涵盖了最新的系统分析师考试大纲信息系统综合知识的所有知识点,分析了近3年信息系统分析与设计案例...
订阅51CTO邮刊

我要回帖

更多关于 default文件夹 的文章

 

随机推荐