AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-489656

spylh9999ggr's questions

Martin Hope
spylh9999ggr
Asked: 2024-04-01 23:30:42 +0800 CST

git log 命令没有给出所有分支的完整提交

  • 5

我想查看所有分支的所有提交。所以我尝试了git log,但它给出了一些结果,并如下图所示:

在此输入图像描述

git
  • 1 个回答
  • 40 Views
Martin Hope
spylh9999ggr
Asked: 2018-01-30 05:01:25 +0800 CST

E: 包 'apache2' 没有安装候选

  • 1

当我尝试在 Ubuntu 14.04 上安装 apache2 时,我收到以下错误消息:

root@Final-Gitsetup-Developers:~# apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package apache2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libapache2-mpm-itk libapache2-mpm-itk:i386

E: Package 'apache2' has no installation candidate 

结果apt-cache policy | grep http | awk '{print $2 $3}' | sort -u

http://archive.ubuntu.com/ubuntu/trusty/universe  
http://repo.mysql.com/apt/ubuntu/wily/mysql-5.6  
http://repo.mysql.com/apt/ubuntu/wily/mysql-apt-config  
http://repo.mysql.com/apt/ubuntu/wily/mysql-tools  
package-management apache2 software-sources 14.04
  • 1 个回答
  • 16625 Views
Martin Hope
spylh9999ggr
Asked: 2017-11-29 23:21:45 +0800 CST

如何 netstat 和 kill 程序的 pid 使服务器正常工作?

  • 0

我们的服务器 [ ubuntu 14.04 ] 不工作,所以当我尝试:sudo service apache2 restart时,我得到:

在此处输入图像描述

然后当我尝试grep -ri listen /etc/apache2时,我得到了

在此处输入图像描述

如前所述,我尝试了netstat -ltnp | grep:80,我得到:

在此处输入图像描述

编辑

/etc/apache2/ports.cnf:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

我没有得到下一步我需要做什么?

14.04
  • 2 个回答
  • 564 Views
Martin Hope
spylh9999ggr
Asked: 2017-10-27 01:44:25 +0800 CST

通过 /etc/apache2/conf-available.phpmyadmin.conf 更改 phpmyadmin url

  • 1

我正在使用托管在数字海洋中的ubuntu 16.04

我想更改 phpmyadmin 访问 url。我看到了链接,但他们提供了 2 个选项:

1)/etc/phpmyadmin/apache.conf - 我试过了,没有运气。

2) /etc/apache2/conf-available/ phpmyadmin.conf,但这里不是 conf 文件类型,它显示在Readbale folder这里有什么问题?

在此处输入图像描述

server
  • 1 个回答
  • 3858 Views
Martin Hope
spylh9999ggr
Asked: 2017-09-14 01:22:01 +0800 CST

检查 curl 是否已安装并加载

  • 2

我收到这样的日志错误:

![在此处输入图像描述

为了解决这个问题,我运行了以下命令并重新启动了服务器。

sudo apt-get install php-curl
sudo /etc/init.d/apache2 restart
sudo service apache2 restart

然后我检查了代码:<?php phpinfo(); ?>,我得到了这个结果:

在此处输入图像描述

我还通过在 Web 浏览器中运行此代码进行了检查:

echo 'Curl: ', function_exists('curl_init') ? 'Enabled' : 'Disabled';

在网络浏览器中,它给出的结果是Disabled.

另外,当我按照检查中的说明进行检查以查看是否在本地安装了 cURL 时?,我得到了这个结果:

在此处输入图像描述

在完成所有这些之后,我仍然收到那些日志错误。卷曲加载了吗?

server
  • 1 个回答
  • 20617 Views
Martin Hope
spylh9999ggr
Asked: 2016-05-13 22:02:53 +0800 CST

Magento PHP cron 作业无法打开所需的 php 文件

  • 1

我们正在尝试为 Magento 站点设置 cron 作业。

我们尝试了这个工作,但它对我们不起作用:

*/5 * * * * php -f /var/www/html/sitename/cron.php

为了调试我们尝试了这个工作:

*/5 * * * * /usr/bin/php  -q /var/www/html/sitename/cron.php > 
/var/www/html/sitename/cron-temp.log 2>&1

结果,我们在以下位置发现了这些错误cron-temp.log:

PHP Warning:  require(app/bootstrap.php): failed to open stream:
 No such file or directory in /var/www/html/sitename/cron.php on line 30

    PHP Fatal error:  require(): Failed opening required 'app/bootstrap.php' 
(include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/sitename
/cron.php on line 30

cron.php

<?php


// Change current directory to the directory of current script
chdir(dirname(__FILE__));

require 'app/bootstrap.php';
require 'app/Mage.php';

if (!Mage::isInstalled()) {
    echo "Application is not installed yet, please complete install wizard first.";
    exit;
}

// Only for urls
// Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);

Mage::app('admin')->setUseSessionInUrl(false);

umask(0);

$disabledFuncs = explode(',', ini_get('disable_functions'));
$isShellDisabled = is_array($disabledFuncs) ? in_array('shell_exec', $disabledFuncs) : true;
$isShellDisabled = (stripos(PHP_OS, 'win') === false) ? $isShellDisabled : true;
$isShellDisabled = true;

try {
    if (stripos(PHP_OS, 'win') === false) {
        $options = getopt('m::');
        if (isset($options['m'])) {
            if ($options['m'] == 'always') {
                $cronMode = 'always';
            } elseif ($options['m'] == 'default') {
                $cronMode = 'default';
            } else {
                Mage::throwException('Unrecognized cron mode was defined');
            }
        } else if (!$isShellDisabled) {
            $fileName = basename(__FILE__);
            $baseDir = dirname(__FILE__);
            shell_exec("/bin/sh $baseDir/cron.sh $fileName -mdefault 1 > /dev/null 2>&1 &");
            shell_exec("/bin/sh $baseDir/cron.sh $fileName -malways 1 > /dev/null 2>&1 &");
            exit;
        }
    }

    Mage::getConfig()->init()->loadEventObservers('crontab');
    Mage::app()->addEventArea('crontab');
    if ($isShellDisabled) {
        Mage::dispatchEvent('always');
        Mage::dispatchEvent('default');
    } else {
        Mage::dispatchEvent($cronMode);
    }
} catch (Exception $e) {
    Mage::printException($e);
    exit(1);
}
php
  • 3 个回答
  • 2643 Views
Martin Hope
spylh9999ggr
Asked: 2016-05-13 04:01:24 +0800 CST

如何设置 cron 来调用 php 脚本 - bash: */5: No such file or directory for setting cron job

  • 0

我们正在尝试为在 ubuntu 服务器中运行的 magento 站点设置 cron

我们正在尝试以下命令:

*/5 * * * * php -f /var/www/html/sitename/cron.php

但我们收到如下错误:

-bash: */5: No such file or directory

更新 1

在此处输入图像描述

更新 2 - 错误

PHP Warning:  require(app/bootstrap.php): failed to open stream: No such file or directory in /var/www/html/sitename/cron.php on line 30

PHP Fatal error:  require(): Failed opening required 'app/bootstrap.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/sitename/cron.php on line 30

cron.php

<?php


// Change current directory to the directory of current script
chdir(dirname(__FILE__));

require 'app/bootstrap.php';
require 'app/Mage.php';

if (!Mage::isInstalled()) {
    echo "Application is not installed yet, please complete install wizard first.";
    exit;
}

// Only for urls
// Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);

Mage::app('admin')->setUseSessionInUrl(false);

umask(0);

$disabledFuncs = explode(',', ini_get('disable_functions'));
$isShellDisabled = is_array($disabledFuncs) ? in_array('shell_exec', $disabledFuncs) : true;
$isShellDisabled = (stripos(PHP_OS, 'win') === false) ? $isShellDisabled : true;
$isShellDisabled = true;

try {
    if (stripos(PHP_OS, 'win') === false) {
        $options = getopt('m::');
        if (isset($options['m'])) {
            if ($options['m'] == 'always') {
                $cronMode = 'always';
            } elseif ($options['m'] == 'default') {
                $cronMode = 'default';
            } else {
                Mage::throwException('Unrecognized cron mode was defined');
            }
        } else if (!$isShellDisabled) {
            $fileName = basename(__FILE__);
            $baseDir = dirname(__FILE__);
            shell_exec("/bin/sh $baseDir/cron.sh $fileName -mdefault 1 > /dev/null 2>&1 &");
            shell_exec("/bin/sh $baseDir/cron.sh $fileName -malways 1 > /dev/null 2>&1 &");
            exit;
        }
    }

    Mage::getConfig()->init()->loadEventObservers('crontab');
    Mage::app()->addEventArea('crontab');
    if ($isShellDisabled) {
        Mage::dispatchEvent('always');
        Mage::dispatchEvent('default');
    } else {
        Mage::dispatchEvent($cronMode);
    }
} catch (Exception $e) {
    Mage::printException($e);
    exit(1);
}
cron
  • 2 个回答
  • 2922 Views
Martin Hope
spylh9999ggr
Asked: 2016-01-06 22:10:04 +0800 CST

将数据库文件上传到数据库的命令

  • 1

此路径中有一个数据库文件:服务器中的 /var/www/db.sql。

我们的数据库大小约为 800mb。

我们必须将此 sql 文件上传到数据库:“age”

用户名:root,密码:pass,数据库密码:dbpass

我正在尝试这个命令。但它不工作。

mysql -u root -p pass age db.sql

我点击了这个链接:https ://stackoverflow.com/questions/19483087/importing-large-sql-file-to-mysql-via-command-line

请给出正确的命令

command-line
  • 1 个回答
  • 2703 Views
Martin Hope
spylh9999ggr
Asked: 2015-10-22 01:15:28 +0800 CST

请告诉我将文件夹从一台服务器移动到另一台服务器时必须使用的命令[重复]

  • 4
这个问题在这里已经有了答案:
使用 SSH ubuntu 复制文件夹(不是一个文件)?[重复] (1 个回答)
6 年前关闭。

我们正在使用 ubuntu 服务器,我必须将文件夹从一台服务器移动到另一台服务器:

文件夹: /var/www/html/demo5/site/app到/var/www/html/1/10/site
(文件夹名称在哪里app)

主机名: 123.123主机456.456

用户名: abc 到用户名:xyz

我有 SSH 访问权限,但我不熟悉这些命令。

我已经尝试过此链接,但由于我不熟悉命令,所以无法正常工作。

command-line
  • 4 个回答
  • 270 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve